Quantcast

Prefix query is not analysed?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Prefix query is not analysed?

Alok Bhandari
Hello ,

I am pushing  "Chuck Follett'.?.?" in solr and when I query for this field with query string field:Follett'.* I am getting 0 results.

field type declared is

   <fieldType name="text_email" class="solr.TextField" stored="true" indexed="true" positionIncrementGap="100">
        <analyzer>
               <tokenizer class="solr.UAX29URLEmailTokenizerFactory" maxTokenLength="255"/>
               <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType> 

and parser we are using is EdisMax .

Is it the case that for prefix query the text analysis is not done I am getting 0 results or there is something fundamentally wrong with my data/schema .
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prefix query is not analysed?

Sascha SZOTT-2
Hi,

wildcard and fuzzy queries are not analyzed.

-Sascha



Alok Bhandari <[hidden email]> schrieb:

Hello ,

I am pushing "Chuck Follett'.?.?" in solr and when I query for this field
with query string field:Follett'.* I am getting 0 results.

field type declared is

<fieldType name="text_email" class="solr.TextField" stored="true"
indexed="true" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.UAX29URLEmailTokenizerFactory"
maxTokenLength="255"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>

and parser we are using is EdisMax .

Is it the case that for prefix query the text analysis is not done I am
getting 0 results or there is something fundamentally wrong with my
data/schema .

--
View this message in context: http://lucene.472066.n3.nabble.com/Prefix-query-is-not-analysed-tp3992435.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prefix query is not analysed?

Alok Bhandari
Thanks for reply.

If I check the debug query through solr-admin I can see that the lower case filter is applied and

  "rawquerystring":"em_to_name:Follett'.*",
    "querystring":"em_to_name:Follett'.*",
    "parsedquery":"+em_to_name:follett'.*",
    "parsedquery_toString":"+em_to_name:follett'.*",
    "explain":{},
    "QParser":"ExtendedDismaxQParser",


I can see this query. So is it the case that only tokenization is not done for the wildcard queries but other filters specified are applied?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prefix query is not analysed?

Sascha SZOTT-2
Hi,

I suppose you are using Solr 3.6. Then take a look at

http://www.lucidimagination.com/blog/2011/11/29/whats-with-lowercasing-wildcard-multiterm-queries-in-solr/

-Sascha



Alok Bhandari <[hidden email]> schrieb:

Thanks for reply.

If I check the debug query through solr-admin I can see that the lower case
filter is applied and

"rawquerystring":"em_to_name:Follett'.*",
"querystring":"em_to_name:Follett'.*",
"parsedquery":"+em_to_name:follett'.*",
"parsedquery_toString":"+em_to_name:follett'.*",
"explain":{},
"QParser":"ExtendedDismaxQParser",


I can see this query. So is it the case that only tokenization is not done
for the wildcard queries but other filters specified are applied?

--
View this message in context: http://lucene.472066.n3.nabble.com/Prefix-query-is-not-analysed-tp3992435p3992450.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prefix query is not analysed?

Alok Bhandari
Yes I am using Solr 3.6.

Thanks for the link it is very useful.
From the link I could make out that if analyzer  includes any one of the following  then they are applied and any other elements specified under analyzer are not applied as they are not multi-term aware.

ASCIIFoldingFilterFactory
LowerCaseFilterFactory
LowerCaseTokenizerFactory
MappingCharFilterFactory
PersianCharFilterFactory


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prefix query is not analysed?

Erick Erickson
Right. But note two things:
1> the filters were made MultiTermAware based on "doing no harm".
    When it comes to this kind of change, we wanted to be sure we
    weren't messing things up. If you are certain that other filters would
    be OK if they were MultiTermAware, let us know and we can make
    then so.
2> you can define your own section of the analysis chain for multiterm and
     put whatever you want in there (in schema.xml). The elements you
     put there do _not_ have to be MultiTermAware. But if they produce
     more than one token for any input tokens, your results will be
     screwy.

Best
Erick


On Mon, Jul 2, 2012 at 4:50 AM, Alok Bhandari
<[hidden email]> wrote:

> Yes I am using Solr 3.6.
>
> Thanks for the link it is very useful.
> From the link I could make out that if analyzer  includes any one of the
> following  then they are applied and any other elements specified under
> analyzer are not applied as they are not multi-term aware.
>
> ASCIIFoldingFilterFactory
> LowerCaseFilterFactory
> LowerCaseTokenizerFactory
> MappingCharFilterFactory
> PersianCharFilterFactory
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Prefix-query-is-not-analysed-tp3992435p3992463.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Loading...