lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Jelsma <markus.jel...@openindex.io>
Subject Re: Uppercase and lowercase queries
Date Tue, 19 Oct 2010 10:34:12 GMT
Yes, and reindex. And i suggest not to use `string` as the name of the 
fieldType as it will confuse later.

<field name="city" type="text_lowercase"
indexed="true" stored="true"/>

    <fieldType name="text_lowercase" class="solr.TextField" 
sortMissingLast="true"
omitNorms="true">
      <analyzer type="index">
                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>       
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
        </fieldType>

On Tuesday, October 19, 2010 12:25:53 pm Pradeep Singh wrote:
> Use text field.
> 
> On Tue, Oct 19, 2010 at 3:19 AM, PeterKerk <vetteparty@hotmail.com> wrote:
> > I want to query on cityname. This works when I query for example:
> > "Boston"
> > 
> > But when I query "boston" it didnt show any results. In the database is
> > stored: "Boston".
> > 
> > So I thought: I should change the filter on this field to make everything
> > lowercase.
> > 
> > 
> > The field definition for city is: <field name="city" type="string"
> > indexed="true" stored="true"/>
> > 
> > So I changed its fieldtype "string" from: <fieldType name="string"
> > class="solr.StrField" sortMissingLast="true" omitNorms="true">
> > 
> > TO:
> >    <fieldType name="string" class="solr.StrField" sortMissingLast="true"
> > 
> > omitNorms="true">
> > 
> >      <analyzer type="index">
> >      
> >                <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        
> >        <filter class="solr.LowerCaseFilterFactory"/>
> >      
> >      </analyzer>
> >      <analyzer type="query">
> >      
> >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory"/>
> >      
> >      </analyzer>
> >      
> >        </fieldType>
> > 
> > But it still doesnt show any results when I query "boston"...why?
> > --
> > View this message in context:
> > http://lucene.472066.n3.nabble.com/Uppercase-and-lowercase-queries-tp1731
> > 349p1731349.html Sent from the Solr - User mailing list archive at
> > Nabble.com.

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536600 / 06-50258350

Mime
View raw message