{"_id": 1, "title": "James Harden wins the MVP", "content": "xxxxxxxxxxxxxxxxxxxxxx"}
{"_id": 2, "title": "The new 007 movie comes!", "content": "xxxx James Bond xxxxxxxxxxxxx"}
And when users searched query James Bond, we may construct es query like this
Generally, if you blend strict and sloppier interpretations of a user query the docs that match best (strict AND sloppy) will rank higher.
In declining order of strictness:
Phrase query (all terms must match and be next to each other in the text)
AND query (all terms must appear somewhere in the text)
OR query (at least one term must match)
fuzzy query (at least one vaguely reminiscent term must match).
These can all be assembled into a single bool query in the should property.
The more clauses a document matches, the higher the score - the downside is it will be more costly to run.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.