1
2關於搜索_id
領域的問題:elastic4s搜索ID
,我想找到是否存在特定ID使用elastic4s DSL。在aquivilent這個查詢elasticsearch API:
捲曲-XGET 'http://localhost:9200/indexName/indexType/_search/exists?q=_id:foo'
我試圖做這樣的事情:
client execute search(indexName/indexType) query ("_id", "foo")
,但是這會產生SearchDefinition
不能被isExists
檢查
我想取所有
_id
的 到目前爲止,我得到了這個解決辦法,但我不知道這是idomatic辦法做到這一點client.execute(搜索(INDEXNAME/INDEXTYPE)查詢‘ID’)。圖( .ids )
謝謝,但泰國人將獲取整個文件。我只是想檢查它是否存在 – igx
我可以做類似'search(「electronics」/「phone」)。query(idsQuery(「foo」))。map(_。nonEmpty)' – igx
你會接受我的回答? – MartinSchulze