lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: sub query parsing bug???
Date Tue, 06 Dec 2011 13:26:44 GMT
Hmmm, does this help?

In Solr 1.4 and prior, you should basically set mm=0 if you want the
equivilent of q.op=OR, and mm=100% if you want the equivilent of
q.op=AND. In 3.x and trunk the default value of mm is dictated by the
q.op param (q.op=AND => mm=100%; q.op=OR => mm=0%). Keep in mind the
default operator is effected by your schema.xml <solrQueryParser
defaultOperator="xxx"/> entry. In older versions of Solr the default
value is 100% (all clauses must match)
(from http://wiki.apache.org/solr/DisMaxQParserPlugin).

I don't think you'll see the query parsed as you expect, but the
results of the query
should be what you expect. Tricky, eh?

I'm assuming you've simplified the example for clarity and your qf
will be on more than one field when you use it "for real", but if not
the actual query doesn't need edismax at all.....

Best
Erick

On Mon, Dec 5, 2011 at 10:52 AM, Steve Fuchs <steve@aps.org> wrote:
> Hello All,
>
> I have my field description listed below, but I don't think its pertinent. As my issue
seems to be with the query parser.
>
> I'm currently using an edismax subquery clause to help with my searching as such:
>
> _query_:"{!type=edismax qf='ref_expertise'}\(nonlinear OR soliton\) AND \"optical lattice\""
>
> translates correctly to
>
> +(+((ref_expertise:nonlinear) (ref_expertise:soliton)) +(ref_expertise:"optical lattice"))
>
>
> but the users expect the default operator to be AND (it is in all simpler searches),
however nothing I can do here gets me that same result as above when the search is:
>
> _query_:"{!type=edismax qf='ref_expertise'}\(nonlinear OR soliton\) \"optical lattice\""
>
> this gets converted to:
>
> +(((ref_expertise:nonlinear) (ref_expertise:soliton)) (ref_expertise:"optical lattice"))
>
> where the "optical lattice" is optional.
>
> These produce the same results, trying q.op and mm. Also the default search term as  set
in the solr.config is AND.
>
> _query_:"{!type=edismax q.op=AND qf='ref_expertise'}\(nonlinear OR soliton\)\"optical
lattice\""
> _query_:"{!type=edismax mm=1.0 qf='ref_expertise'}\(nonlinear OR soliton\)\"optical lattice\""
>
>
>
>
> Any ideas???
>
> Thanks In Advance
>
> Steven Fuchs
>
>
>
>
>
>
>    <fieldType name="intl_string" class="solr.TextField" >
>      <analyzer type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.WordDelimiterFilterFactory" preserveOriginal="1"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.ASCIIFoldingFilterFactory" />
>        <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="25"
/>
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.ASCIIFoldingFilterFactory" />
>      </analyzer>
>    </fieldType>
>
>
>
>
>
>
>
>
>

Mime
View raw message