lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <s...@elyograg.org>
Subject Re: Which Lucene search syntax is faster
Date Wed, 30 Apr 2014 22:39:38 GMT
On 4/30/2014 3:47 PM, johnmunir@aol.com wrote:
> Thank you Shawn and Erick for the quick response.
>
>
> A follow up question.
>
>
> Basedon https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-Thefq%28FilterQuery%29Parameter,I
see the "fl" (field list) parameter.  Does this mean I canbuild my Lucene search syntax as
follows:

The fl parameter determines which stored fields show up in the results. 
By default, all fields that are stored will be returned.  If you want
relevancy scores, you'd include the pseudofield named "score" --
&fl=*,score is something we see a lot.  The fl parameter does not affect
the *search* at all.

>     q=skyfall OR ian ORfleming&fl=title&fl=owner&fq=doc_type:DOC
>
>
> And get the same result as (per Shawn's example changed it bit toadd OR):
>
>
>     q=title:(skyfall OR ian OR fleming)owner:(skyfall OR ian OR fleming)&fq=doc_type:DOC

Exactly right.

> Btw, my default search operator is set to AND.  My need is tofind whatever the user types
in both of those two fields (or maybe some otherfields which is controlled by the UI).. For
example, user types"skyfall ian fleming" and selected 3 fields, and want to narrowdown to
doc_type DOC.

With the standard parser, you'd have to do the following.  Assume that
USERQUERY is a very basic query, perhaps a few terms, like your example
of "skyfall ian fleming".

q=field1:(USERQUERY) OR field2:(USERQUERY) OR
field3:(USERQUERY)&fq=doc_type:DOC

With edismax, you'd do:

q=USERQUERY&qf=field1 field2 field3&fq=doc_type:DOC

You might also add "&pf=field1 field2 field3" ... and there are a great
many other edismax/dismax query parameters too.  The edismax parser does
some truly amazing stuff.

Echoing what both Erick and I said ... worrying about the exact syntax
is premature optimization.  10 million docs is something that Solr can
handle easily, as long as there's enough RAM.

Thanks,
Shawn


Mime
View raw message