You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Diego Fernandez <di...@redhat.com> on 2014/05/30 22:40:59 UTC
Sum of nested queries in Solr
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
Re: Sum of nested queries in Solr
Posted by Ahmet Arslan <io...@yahoo.com>.
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 <di...@redhat.com> 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