How do you do a match query with and operator?


#1

I'm finding the documentation on elasticsearch 5.5 to be sparse, inaccurate and overall frustrating. I have a simple match query. When I try to use the "and" operator. It returns no results. Older google searches for "multiword" queries from 2.2 give more detail yet those pages no longer exist for 5.5.

{
"query": {
"match": {
"pdf.pages.topics.topic": {
"query":"process applicant",
"operator":"and",
"analyzer":"my_english"
}
}

}
}

If I remove the "operator" statement I get results and I can clearly see the words in the topic field. Sadly, elastic documentation only alludes to the many other requirements you need for the meager examples to work. So what is the trick to get this kind of query to return results? Most basic query here.


(Simon Willnauer) #2

thanks for your kind words, I am sure you have some spare time to improve the documentation and then you feel the same way I do when somebody says what you said about your work.

now that you motivate me to help you, if and doesn't return anything then you maybe don't have any docs with "process" AND "applicant" in the field "pdf.pages.topics.topic" and if you remove it it defaults to OR and that might return more. This is btw. clearly documented here

thank you for using elasticsearch


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.