I would like to boost a query based on whether a separate field of the
document contains the query term. This is similar to a bool query with
must/should clauses except I would like the clauses' scores to be
multiplied rather than added. Basically, I would like the score to be
mainly based on the main query, but just slightly modified based on the
separate field. If I do a bool query, it seems as though there is a fairly
good chance that in certain cases the 'should' clause on the separate field
could play too large or too small a role during scoring.
I would like to boost a query based on whether a separate field of the
document contains the query term. This is similar to a bool query with
must/should clauses except I would like the clauses' scores to be
multiplied rather than added. Basically, I would like the score to be
mainly based on the main query, but just slightly modified based on the
separate field. If I do a bool query, it seems as though there is a fairly
good chance that in certain cases the 'should' clause on the separate field
could play too large or too small a role during scoring.
How would that work? I would need to see if the analyzed query term(s) hit the document field. I can see the function score working if the boost factor is pre-computed and captured in a numerical field, but that isn't what I am trying to do here.
On Dec 6, 2013, at 2:58 AM, Alexander Reelsen wrote:
On Fri, Dec 6, 2013 at 1:12 AM, slushi kireetreddy@gmail.com wrote:
I would like to boost a query based on whether a separate field of the document contains the query term. This is similar to a bool query with must/should clauses except I would like the clauses' scores to be multiplied rather than added. Basically, I would like the score to be mainly based on the main query, but just slightly modified based on the separate field. If I do a bool query, it seems as though there is a fairly good chance that in certain cases the 'should' clause on the separate field could play too large or too small a role during scoring.
Basically, I would like the score to be mainly based on the main query,
but just slightly modified based on the separate field. If I do a bool
query, it seems as though there is a fairly good chance that in certain
cases the 'should' clause on the separate field could play too large or too
small a role during scoring.
This text makes the Boosting Query ( Elasticsearch Platform — Find real-time answers at scale | Elastic)
sound like the best choice or a bool query with very different boosts on
the clauses. Those both basically add the scaled scores together. Like
this: score = score_1 * 10 + score_2.
I don't believe there is a query type that scores by multiplying results,
though. I mean, one like this: score = score_1 * score_2. I'm not sure
the exact use case for such a thing, though.
The use case is as follows: I have several documents with a full text field
as well as metadata fields (title, tags, etc). It seems to me that the main
driver of relevance should be the full text field, but if a metadata field
also matches, I would like to experiment with boosting the score. The issue
with adding scores is that the metadata field clause could contribute too
much or too little to the final score. instead i would like to do something
like "score the query against the full text field and if it also matches a
metadata field, boost the score by 10%".
On Friday, December 6, 2013 11:27:21 AM UTC-5, Nikolas Everett wrote:
On Thu, Dec 5, 2013 at 7:12 PM, slushi <kiree...@gmail.com <javascript:>>wrote:
Basically, I would like the score to be mainly based on the main query,
but just slightly modified based on the separate field. If I do a bool
query, it seems as though there is a fairly good chance that in certain
cases the 'should' clause on the separate field could play too large or too
small a role during scoring.
This text makes the Boosting Query ( Elasticsearch Platform — Find real-time answers at scale | Elastic)
sound like the best choice or a bool query with very different boosts on
the clauses. Those both basically add the scaled scores together. Like
this: score = score_1 * 10 + score_2.
I don't believe there is a query type that scores by multiplying results,
though. I mean, one like this: score = score_1 * score_2. I'm not sure
the exact use case for such a thing, though.
The use case is as follows: I have several documents with a full text
field as well as metadata fields (title, tags, etc). It seems to me that
the main driver of relevance should be the full text field, but if a
metadata field also matches, I would like to experiment with boosting the
score. The issue with adding scores is that the metadata field clause could
contribute too much or too little to the final score. instead i would like
to do something like "score the query against the full text field and if it
also matches a metadata field, boost the score by 10%".
On Friday, December 6, 2013 11:27:21 AM UTC-5, Nikolas Everett wrote:
Basically, I would like the score to be mainly based on the main query,
but just slightly modified based on the separate field. If I do a bool
query, it seems as though there is a fairly good chance that in certain
cases the 'should' clause on the separate field could play too large or too
small a role during scoring.
This text makes the Boosting Query (http://www.elasticsearch.org/
guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html)
sound like the best choice or a bool query with very different boosts on
the clauses. Those both basically add the scaled scores together. Like
this: score = score_1 * 10 + score_2.
I don't believe there is a query type that scores by multiplying results,
though. I mean, one like this: score = score_1 * score_2. I'm not sure
the exact use case for such a thing, though.
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.