i had done a search with my keyword "ho rua con" and 100% matching in
elasticsearch document.... but i have another document named "ho con rua"
... and when i search again .why is "ho rua con" score is equal to "ho con
rua" score ???
i had done a search with my keyword "ho rua con" and 100% matching in
elasticsearch document.... but i have another document named "ho con
rua" ... and when i search again .why is "ho rua con" score is equal
to "ho con rua" score ???
--
Your English is fine. Your English is a lot better than many postings on
the internet. It seems clear to me. I think the longer phrases help a lot.
query_string takes what you enter and interprets not as a phrase, but as
individual parts of a Lucene query expression.
Therefore [ho] and [rua] and [con] are interpreted as separate terms
instead of a phrase.
query: { <--- the outer query that you are building
bool: { <-- the query used to put together everything you add with the [+] button.
must: [ <-- your defined use of must to combine this expression in the overall boolean query
{ "bool" : { <-- my expansion of the query_string
"should": [ <-- default for Lucene queries
{term: { "testarea_name":"ho"}, <-- your terms in the "generated" query
{term: { "testarea_name":"rua"},
{term: { "testarea_name":"con"}
]
}
]
}
}
I've shown it in ES format, even though it is never an ES query. It goes
directly to Lucene.
In Lucene
I am using square brackets to delineate queries, because I find it confusing
to use quotes, because quotes are special syntax in Lucene queries.
If you want a phrase, use quotes [ "ho rua con" ]. In the search box you
enter actual quotes.
You can then add slop (total extra words allowed) and even boost after
the quotes.
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.