Basically I have two queries that I would like to combine in a somewhat
unusual way.
Lets say query A is "Albino Melanism" and query B is* "Elephant Tiger"*.
I have lots of search results which have either one or the other, but I am
mostly interested in those where both queries return at least some score.
Any text only containing all the words of query A or query B should be
scored lower than a query containing some of query A and query B. (e.g. the
document with the text "Albino Melanism ..." is worth nothing if there is
no mention of an elephant or tiger, I'd rather have the text "Albino
Elephant ..." with no mentions of tigers / melanism)
A dismax query does pretty much the opposite of what I want to do: It takes
two subqueries and returns the maximum. However I actually want the minimum
of those subqueries.
A dismax query will basically rewrite the query as a boolean query. Can you
create your own query where one of the clauses has a negative boost? Still
tricky since you basically need the inverse of cross/best_field where the
field remains the same, but the query changes.
--
Ivan
On Thu, Aug 28, 2014 at 2:26 AM, Lucas Brönnimann acriaos@gmail.com wrote:
Hi all
Basically I have two queries that I would like to combine in a somewhat
unusual way.
Lets say query A is "Albino Melanism" and query B is* "Elephant Tiger"*.
I have lots of search results which have either one or the other, but I am
mostly interested in those where both queries return at least some score.
Any text only containing all the words of query A or query B should be
scored lower than a query containing some of query A and query B. (e.g. the
document with the text "Albino Melanism ..." is worth nothing if there is
no mention of an elephant or tiger, I'd rather have the text "Albino
Elephant ..." with no mentions of tigers / melanism)
A dismax query does pretty much the opposite of what I want to do: It
takes two subqueries and returns the maximum. However I actually want the
minimum of those subqueries.
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.