2
我爲應用程序使用ElasticSearch來存儲和搜索數據。 因爲在我的特定情況下搜索關係也很重要,所以我最近更改了數據的結構,現在我正在使用_parent字段。 (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-parent-field.html)ElasticSearch:使用JEST插入具有_parent字段的元素
我已經設計了搜索查詢,它工作得很好。但是,在我的數據庫中插入新的子項時,我現在遇到了問題。
它應該是這樣的:
沒有_parent場,當我想實現這個
$ curl -XPUT 'http://localhost:9200/data/child/1' -d '
我插入的數據使用JEST API是這樣的:
client.execute(new Index.Builder(payload).index("data").type("child").build());
W母雞我想實現這一點:
$ curl -XPOST localhost:9200/data/child?parent=154121-d'
我該如何使用JEST-API實現這個功能?
我已經在Google // Stackoverflow上搜尋了一個答案,但沒有拿出解決方案。
預先感謝您! :)
你沒有:)謝謝 – Lorenzo 2015-07-17 13:39:31