Saturday, 15 March 2014

Elasticsearch: Get report of unmatched should elements in a bool query -


I am looking for a way to get reports of unmatched, to query and display it. For example, I have two user objects

User 1:

  {"username": "user1" "docType": "user" "level": " Professor "discipline": "science" "sub-discipline": "mathematical"}  

user 2:

  {"username": "user1 "DocType": "user" "level": "professor" "discipline": "science" "sub-discipline": "physics"}  

when I do a ball query Where Milan is in discipline should ask and sub-disciplines Should be in the query : {{word: {"doc.docType": "user"}}, {word: {"doctor level": "professor"}}, {Word: {"doc.discipline": "science"}}}, should: [{post: {"sub-disassembly": "physics"}}]

How can I find mismatched elements in my result:

  Results 1: user1 match 100% result 2: user2 match 70% (unmachined subdiscien "physics")  

I had a look at the API to explain it but as a result The do not seem to use and seems very complicated to parse.

You have to use it for. Using the same, create a ball query as below -

  {"query": {"bool": {"must": [{"" match: {"sourceName": { "Query": "CNN", "_name": "sourceMatch"}}}, {"match": {"author": {"query": "qbox.io", "_name": "author"}}} ]}}}  

In the results section, it will show how all named queries match. You can use this information to build the data you are looking for.


No comments:

Post a Comment