[关闭]
@dooy 2017-09-18T13:00:18.000000Z 字数 7095 阅读 192

好策数据ES分析 相似服务器部署

数据格式 好策


一、数据源:haoce/topic 主题表

管理 http://es54.jukuu.com
SQL管理 http://es54.jukuu.com/_plugin/sql/

字段 类型 说明
topic_id int 主题id
book_id int 书id
user_id int 用户id
tag_id int 用户类型id
ctime 时间格式 创建时间
title string 标题
content string 内容
  1. {"index":{"_id":"28"}}
  2. {"topic_id":28,"book_id":22,"user_id":56,"tag_id":0,"ctime":"2017-08-07T17:03:41+08:00","title":"What Do You Think of Charlotte\uff1f","content":"Charlotte Lucas, a 27-year-old unmarried woman, Elizabeth's good friend, looks flat,with flat family but extraordinary knowledge. Charlotte is very sensible, she clearly knows what she will be in the future, she knows what she wants. For her own marriage, she knows that she can make the best choice, when it comes to love, silently waiting for love; after waiting for lost hope, she can accept the choice of the best results. So when she knew that she is salready a burden which with no money and no prospects to her parents, she marriged with Mr. Collins\uff0cbecause she knows that she should be as happy with him as any other. Not all of us can afford to be romantic. She knows what is best for herself, this is where I appreciate her most."}

二、相似服务器部署

环境:java

  1. java -version
  2. java version "1.8.0_92"
  3. Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
  4. Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

tomcat版本 apache-tomcat-9.0.0.M26.tar.gz

1.HaoCeCheckServer 相似后端

解压后直接启动

  1. nohup java -jar HaoCeCheckServer.jar > server.log &

配置文件 config.properties

  1. elasticsearch.server=127.0.0.1 #es 服务器
  2. elasticsearch.port=9300 #es 端口
  3. search.threadcnt=4
  4. search.pagecnt=10
  5. minsim=10
  6. rmi.ip=127.0.0.1
  7. rmi.port=8886

2. 相似webserver

将 HaoCeCheckWebService 解压并复制到 tomcat到webapps后面
解压后面的目录是$tomcat_dir/webapps/HaoCeCheckWebService/
启动tomcat

  1. $tomcat_dir/bin/startup.sh

3.测试

接口:http://127.0.0.1:8080/HaoCeCheckWebService/CheckService
参数:

参数 说明
limit 显示条数默认是10条
user_id 用户id 用于排除自己 不讲自己的文章算在相似内
content 需要比对的内容
  1. curl "http://127.0.0.1:8080/HaoCeCheckWebService/CheckService?limit=10&user_id=1&content=Wendelin+Van+Draanen+is+at+her+best+here+with+a+knockout+cast+of+quirky+characters+and+a+hilarious+series+of++and+missed+opportunities.+But+underlying+the+humor+are+two+teens+in+transition.In+the+book+Pride+and+Prejudice+we+can+find+many+distinctive+characters%2c+like+Mr.+Collins+who+spared+all+his+effort+to+please+Lady+Catherine%2c+an+arrogant+and+selfish+lady%2c+Mrs.+Collins+who+got+married+with+somebody+she+didn%27t+love+but+who+could+provide+her+with+a+steady+life%2c+the+wise+father+Mr.+Bennet%2c+the+naive+and+frivolous+little+girl+Lydia+and+so+on.+Some+people+may+judge+their+behaviour+or+personalities%2c+but+in+my+opinoin%2c+that%27s+every+single+person%27s+right+to+choose+to+be+who+they+want+to+be.+Hope+you+and+me+can+also+find+the+character+we+want+to+act+in+the+movie+named+life.+so+she+urged+Elizebath+to+marry+with+him.+Elizebath+is+enough+brave+to+refuse+her+mother+firmly"
  2. curl -X POST -d "content=Wendelin+Van+Draanen+is+at+her+best+here+with+a+knockout+cast+of+quirky+characters+and+a+hilarious+series+of++and+missed+opportunities.+But+underlying+the+humor+are+two+teens+in+transition.In+the+book+Pride+and+Prejudice+we+can+find+many+distinctive+characters%2c+like+Mr.+Collins+who+spared+all+his+effort+to+please+Lady+Catherine%2c+an+arrogant+and+selfish+lady%2c+Mrs.+Collins+who+got+married+with+somebody+she+didn%27t+love+but+who+could+provide+her+with+a+steady+life%2c+the+wise+father+Mr.+Bennet%2c+the+naive+and+frivolous+little+girl+Lydia+and+so+on.+Some+people+may+judge+their+behaviour+or+personalities%2c+but+in+my+opinoin%2c+that%27s+every+single+person%27s+right+to+choose+to+be+who+they+want+to+be.+Hope+you+and+me+can+also+find+the+character+we+want+to+act+in+the+movie+named+life.+so+she+urged+Elizebath+to+marry+with+him.+Elizebath+is+enough+brave+to+refuse+her+mother+firmly" "http://127.0.0.1:8080/HaoCeCheckWebService/CheckService?limit=1&user_id=47"

应答体

  1. [
  2. {
  3. "book_id": "98",
  4. "ctime": "2017-08-20T10:31:47+08:00",
  5. "lcontent": "<font color='red' id=0>Wendelin Van Draanen is at her best here with a knockout cast of quirky characters and a hilarious series of </font><font color='red' id=1> and missed opportunities.</font><font color='red' id=2> But underlying the humor are two teens in transition.</font>In the book Pride and Prejudice we can find many distinctive characters, like Mr. Collins who spared all his effort to please Lady Catherine, an arrogant and selfish lady, Mrs. Collins who got married with somebody she didn't love but who could provide her with a steady life, the wise father Mr. Bennet, the naive and frivolous little girl Lydia and so on. Some people may judge their behaviour or personalities, but in my opinoin, that's every single person's right to choose to be who they want to be. Hope you and me can also find the character we want to act in the movie named life. so she urged Elizebath to marry with him. Elizebath is enough brave to refuse her mother firmly",
  6. "rcontent": "The first time she saw him, she flipped. The first time he saw her, he ran. That was the second grade, but not much has changed by the seventh. She says: &ldquo;My Bryce. Still walking around with my first kiss.&rdquo; He says: &ldquo;It&rsquo;s been six years of strategic avoidance and social discomfort.&rdquo; But in the eighth grade everything gets turned upside down. And just as he&rsquo;s thinking there&rsquo;s more to her than meets the eye, she&rsquo;s thinking that he&rsquo;s not quite all he seemed. This is a classic romantic comedy of errors told in alternating chapters by two fresh, funny new voices. <font color='red' id=0>Wendelin Van Draanen is at her best here with a knockout cast of quirky characters and a hilarious series of </font>misunderstandings<font color='red' id=1> and missed opportunities.</font><font color='red' id=2> But underlying the humor are two teens in transition.</font> They are each learning to look beyond the surface of people, both figuring out who they are, who they want to be, and who they want to be with.",
  7. "sim": "21.65",
  8. "simcnt": "189",
  9. "tag_id": "4",
  10. "title": "The first time she saw him",
  11. "topic_id": "48",
  12. "user_id": "102"
  13. },
  14. {
  15. "book_id": "22",
  16. "ctime": "2017-08-15T00:07:27+08:00",
  17. "lcontent": "Wendelin Van Draanen is at her best here with a knockout cast of quirky characters and a hilarious series of and missed opportunities. But underlying the humor are two teens in transition.In the book Pride and Prejudice we can find many distinctive characters, like Mr. Collins who spared all his effort to please Lady Catherine, an arrogant and selfish lady, Mrs. Collins who got married with somebody she didn't love but who could provide her with a steady life, the wise father Mr. Bennet, the naive and frivolous little girl Lydia and so on. Some people may judge their behaviour or personalities, but in my opinoin, that's every single person's right to choose to be who they want to be. Hope you and me can also find the character we want to act in the movie named life.<font color='red' id=0> so she urged Elizebath to marry with him.</font> <font color='red' id=1>Elizebath is enough brave to refuse her mother firmly</font>",
  18. "rcontent": " After reading the novel, we know that the man Mr.Collins wanted to have a wife,so he requested Ms. Bennet to persuade her beatuiful daughter Elizabeth to marry with him. Ms. Bennet was afraid of Collins,<font color='red' id=0> so she urged Elizebath to marry with him.</font> Luckily,<font color='red' id=1>Elizebath is enough brave to refuse her mother firmly</font>. Elizebath thought that the marriage shouldn't be influenced by money.Also,the marriage without love is unacceptable.And we should live for herself, and we must protect her love firmly. Do you think so?",
  19. "sim": "10.88",
  20. "simcnt": "95",
  21. "tag_id": "0",
  22. "title": "We should live for ourselves and protect our love bravely. Do you think so?",
  23. "topic_id": "42",
  24. "user_id": "38"
  25. }
  26. ]
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注