elasticsearch - HigashiKed/patent_prior-art_search GitHub Wiki
- 既存特許データをelasticsearchにinsertする(bulk_insertでipgファイルをelasticsearchに)
- データが膨大にあるので、aws elasticsearchを利用
elasticsearchのインストール
起動
動作確認
情報の確認
-
mapping取得
curl http://localhost:9200/clef_patent/_search?pretty -H "Content-type: application/json" -d '{"size":1}'
curl http://localhost:9200/clef_patent/_mapping?pretty
-
index削除
curl -XDELETE localhost:9200/us?pretty=true
-
indexに入っているデータ数取得
curl localhost:9200/us/_count
-
任意のidの存在検索
curl -XGET "http://localhost:9200/clef_patent/_doc/EP-0693365-A3/_source?pretty=true"
-
全部ヒット
_body = { "query": { "match_all": {} } }
-
TFiDF取得 https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html
全文検索クエリを利用する場合、検索対象とするフィールドのデータ型が text 型でなければならないことに注意してください。今回のインデックスでは description フィールドを text 型として定義しているので、description フィールドに対して検索をかけていきます。 https://blog.chocolapod.net/momokan/entry/114