sorry - this should have been posted on the Lucene user list.

...the solution is to use the lucene PerFieldAnalyzerWrapper and add the
field with the KeywordAnalyzer then pass the PerFieldAnalyzerWrapper to
the QueryParser.

-Ben

> -----Original Message-----
> From: Ben Incani [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 19 October 2007 5:52 PM
> To: solr-user@lucene.apache.org
> Subject: lowercase text/strings to be used in list box
> 
> I have a field which will only contain several values (that 
> include spaces).
> 
> I want to display a list box with all possible values by 
> browsing the lucene terms.
> 
> I have setup a field in the schema.xml file.
> 
>     <fieldtype name="text_lc" class="solr.TextField">
>       <analyzer>
>         <tokenizer class="solr.KeywordTokenizerFactory"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>       </analyzer>
>     </fieldtype>
> 
> I also tried;
> 
>     <fieldtype name="string_lc" class="solr.StrField">
>       <analyzer>
>         <tokenizer class="solr.LowerCaseTokenizerFactory"/>
>         <filter class="solr.LowerCaseFilterFactory"/>
>       </analyzer>
>     </fieldtype>
> 
> 
> This allows me to browse all the values no problem, but when 
> it comes to search the documents I have to use the lucene 
> org.apache.lucene.analysis.KeywordAnalyzer, when I would 
> rather use the 
> org.apache.lucene.analysis.standard.StandardAnalyzer and the 
> power of the default query parser to perform a phrase query 
> such as my_field:(the
> value) or my_field:"the value", which don't work?
> 
> So is there a way to prevent tokenisation of a field using 
> the StandardAnalyzer, without implementing your own TokenizerFactory?
> 
> Regards
> 
> Ben
> 

Reply via email to