Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions part-5/实战1-电影搜索服务/movie-search/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
课程demo
# 电影搜索服务
## 课程demo
```
安装配置
app-search.yml:
Expand All @@ -8,4 +9,18 @@ allow_es_settings_modification: true

action.auto_create_index: ".app-search-*-logs-*,-.app-search-*,+*"

```



准备数据,使用python 2.7
APP_SEARCH_NAME=tmdb APP_SEARCH_PWD=private-dtcda1pdruoq2hvwqe8rhz1x python ./ingest_tmdb_to_appserarch.py

# 使用最新版本的 node
nvm list
nvm use default

```

## 补充阅读
- APP Search Release - https://www.elastic.co/blog/elastic-app-search-is-now-generally-available
- Search UI - https://www.elastic.co/blog/search-ui-1-0-0-released?baymax=web&elektra=search-ui-webinar
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import requests
import json
import os

APP_NAME= os.getenv('APP_SEARCH_NAME')
APP_PWD = os.getenv('APP_SEARCH_PWD')

def extract():
f = open('./tmdb.json')
Expand All @@ -19,8 +22,8 @@ def index_all(movieDict={}):
def index_doc(doc):
content=[]
content.append(doc)
resp = requests.post("http://localhost:3002/api/as/v1/engines/tmdb/documents",
headers={"content-type":"application/json","Authorization": "Bearer private-o5waw7vawazryrxce6ktu6dr"},
resp = requests.post("http://localhost:3002/api/as/v1/engines/"+APP_NAME+"/documents",
headers={"content-type":"application/json","Authorization": "Bearer "+APP_PWD},
data=json.dumps(content))
print resp

Expand Down