lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Jakl <jakl.mich...@gmail.com>
Subject Re: edismax/dismax/Lucene Query Parser converts some fields to be "mandatory"
Date Mon, 23 Jan 2012 18:55:26 GMT
Hi!

On Mon, Jan 23, 2012 at 18:42, Erick Erickson <erickerickson@gmail.com> wrote:
> Count your parentheses (anyone here speak Lisp?) I think that +
> is outside the entire clause, meaning it's saying that there is
> a single mandatory clause, and it's the whole thing....

You're right in that case it's the whole query. Pardon me, I chose a
bad example. Using your input concerning the boost values, here
another (cleaner) example (edited for readability):


<str name="querystring">
"java"
 OR "haskell"
 OR "python"
 OR "ruby"
 AND "programming"
 OR "programming language"
 OR "code coding"
 OR -"mobile"
 OR -"android"
 OR -"microsoft"
 OR -"windows"
</str>
<str name="parsedquery">
+(
  DisjunctionMaxQuery((stemmedText:java))
  DisjunctionMaxQuery((stemmedText:haskell))
  DisjunctionMaxQuery((stemmedText:python))
 +DisjunctionMaxQuery((stemmedText:ruby))
 +DisjunctionMaxQuery((stemmedText:program))
 DisjunctionMaxQuery((stemmedText:"program language"))
 DisjunctionMaxQuery((stemmedText:"code code"))
 -DisjunctionMaxQuery((stemmedText:mobile))
 -DisjunctionMaxQuery((stemmedText:android))
 -DisjunctionMaxQuery((stemmedText:microsoft))
 -DisjunctionMaxQuery((stemmedText:window))
)
</str>

I've tried this using the three mentioned query parsers, all promote
"ruby" and "program" to be mandatory. I was hoping for a
"dontBeTooSmart=true" switch or something.

> But boosting by 0.0 is probably a really bad thing. This may be
> dropping all the scores to 0, which means "no match". The
> default boost is 1.0 since it's multiplied to influence the score,
> not added. So I'd try either not boosting or making
> it something other than 0.

Thank you very much for spotting this. The FAQ[1] is a bit confusing
on that matter, if a boost of 0.0001 is still a boost, so 0.0 must be
no boost at all, at least that was my logic.

Cheers,
Michael

 1: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_do_I_give_a_negative_.28or_very_low.29_boost_to_documents_that_match_a_query.3F

Mime
View raw message