Uppercase and lowercase queries

2010-10-19 Thread PeterKerk

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-tp1731349p1731349.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Uppercase and lowercase queries

2010-10-19 Thread Pradeep Singh
Use text field.

On Tue, Oct 19, 2010 at 3:19 AM, PeterKerk vettepa...@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-tp1731349p1731349.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: Uppercase and lowercase queries

2010-10-19 Thread Markus Jelsma
Because you need to reindex.

On Tuesday, October 19, 2010 12:19:53 pm PeterKerk 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?

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


Re: Uppercase and lowercase queries

2010-10-19 Thread Markus Jelsma
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 vettepa...@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


Re: Uppercase and lowercase queries

2010-10-19 Thread PeterKerk

I now used textfield...and it works, so thanks! :)
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/Uppercase-and-lowercase-queries-tp1731349p1731423.html
Sent from the Solr - User mailing list archive at Nabble.com.