You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Robert Petersen <ro...@buy.com> on 2010/08/09 20:04:51 UTC

It seems like using a wildcard causes lowercase filter to not do the lowercasing?

I have a field with lowercase filter on search and index sides, and
searching in this field works fine with uppercase or lowercase terms,
except if I wildcard!  So searching for 'gps' or 'GPS' returns the same
result set, but searching for 'gps*' returns results as expected and
searching for 'GPS*' returns nothing.  It seems the asterisk blocks the
lower case filter operation and then no matches occur because the index
is all lowercased.

 

This is a very simple index with very simple docs, and the field is
defined like this in the schema:

 

<field name="phraseNoSpaces"  type="alphaOnlySort" indexed="true"
stored="false" required="true"/>

 

 

            <fieldType name="alphaOnlySort" class="solr.TextField"
sortMissingLast="true" omitNorms="true">

                  <analyzer>

                        <tokenizer
class="solr.KeywordTokenizerFactory"/>

                        <filter class="solr.LowerCaseFilterFactory" />

                        <filter class="solr.TrimFilterFactory" />

                  </analyzer>

            </fieldType>

 


RE: It seems like using a wildcard causes lowercase filter to not do the lowercasing?

Posted by Robert Petersen <ro...@buy.com>.
Aha, I overlooked that.  Thank you.

-----Original Message-----
From: Ahmet Arslan [mailto:iorixxx@yahoo.com] 
Sent: Monday, August 09, 2010 1:28 PM
To: solr-user@lucene.apache.org
Subject: Re: It seems like using a wildcard causes lowercase filter to not do the lowercasing?

> I have a field with lowercase filter
> on search and index sides, and
> searching in this field works fine with uppercase or
> lowercase terms,
> except if I wildcard!  So searching for 'gps' or 'GPS'
> returns the same
> result set, but searching for 'gps*' returns results as
> expected and
> searching for 'GPS*' returns nothing.  It seems the
> asterisk blocks the
> lower case filter operation and then no matches occur
> because the index
> is all lowercased.

"Unlike other types of Lucene queries, Wildcard, Prefix, and Fuzzy queries are not passed through the Analyzer" [1]

[1]http://wiki.apache.org/lucene-java/LuceneFAQ#Are_Wildcard.2C_Prefix.2C_and_Fuzzy_queries_case_sensitive.3F


      

Re: It seems like using a wildcard causes lowercase filter to not do the lowercasing?

Posted by Ahmet Arslan <io...@yahoo.com>.
> I have a field with lowercase filter
> on search and index sides, and
> searching in this field works fine with uppercase or
> lowercase terms,
> except if I wildcard!  So searching for 'gps' or 'GPS'
> returns the same
> result set, but searching for 'gps*' returns results as
> expected and
> searching for 'GPS*' returns nothing.  It seems the
> asterisk blocks the
> lower case filter operation and then no matches occur
> because the index
> is all lowercased.

"Unlike other types of Lucene queries, Wildcard, Prefix, and Fuzzy queries are not passed through the Analyzer" [1]

[1]http://wiki.apache.org/lucene-java/LuceneFAQ#Are_Wildcard.2C_Prefix.2C_and_Fuzzy_queries_case_sensitive.3F