Sum of nested queries in Solr

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sum of nested queries in Solr

aiguofer
Hi! I have a question which I posted on http://stackoverflow.com/questions/23959727/sum-of-nested-queries-in-solr about taking the sum of OR'd nested queries.  I'll repeat it here, but if you want some SO points and have an answer, feel free to answer there.

[quote]

We have a search that takes text from two different fields and then searches against 3 different fields.

The two input fields are a summary and description, and the fields we're searching in are issue, title, and body. We'd like to essentially perform the 2 queries and then add up their score. We'd also like to boost the summary query and the issue field. Here's what I have right now (slightly simplified):

_query_:"{!edismax qf='issue^2 body title' boost=1.5}<summary query>" OR _query_:"{!edismax qf='issue^2 body title'}<description query>"

The problem with this is that if either summary or description don't match to anything in a result, the result gets penalized with coord(1/2). I would like to simply add the two together and ignore the coord. Is there a way to do this?

[/quote]

Thanks!

Diego Fernandez - 爱国
Software Engineer
US GSS Supportability - Diagnostics


Reply | Threaded
Open this post in threaded view
|

Re: Sum of nested queries in Solr

iorixxx
Hi,

Custom similarity returning 1 in coord factor?

http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/search/similarities/TFIDFSimilarity.html#coord(int,%20int)



On Friday, May 30, 2014 11:41 PM, Diego Fernandez <[hidden email]> wrote:
Hi! I have a question which I posted on http://stackoverflow.com/questions/23959727/sum-of-nested-queries-in-solr about taking the sum of OR'd nested queries.  I'll repeat it here, but if you want some SO points and have an answer, feel free to answer there.

[quote]

We have a search that takes text from two different fields and then searches against 3 different fields.

The two input fields are a summary and description, and the fields we're searching in are issue, title, and body. We'd like to essentially perform the 2 queries and then add up their score. We'd also like to boost the summary query and the issue field. Here's what I have right now (slightly simplified):

_query_:"{!edismax qf='issue^2 body title' boost=1.5}<summary query>" OR _query_:"{!edismax qf='issue^2 body title'}<description query>"

The problem with this is that if either summary or description don't match to anything in a result, the result gets penalized with coord(1/2). I would like to simply add the two together and ignore the coord. Is there a way to do this?

[/quote]

Thanks!

Diego Fernandez - 爱国
Software Engineer
US GSS Supportability - Diagnostics