What type of Field to index and Query to search for value of "OR" (Oregon state)?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   BG_San
Posted On:   Friday, August 27, 2004 12:01 AM

I need to index a state field of US state codes (CA, NY, OR). What type of Field should this be stored in Document? I stored them in Field.Text, but doing Term or Phrase in search of Oregon state "OR" didn't really work. But making a boolean query from QueryParser.parse(""OR") did not work either. What should be the right Query type or boolean syntax to search this value?

Re: What type of Field to index and Query to search for value of "OR" (Oregon state)?

Posted By:   Esteve_Olm  
Posted On:   Wednesday, September 15, 2004 05:31 AM

I would try to index de state field with a lowercase filter. Then Oregon will be "or" and not "OR" that is a reserved word.

Re: What type of Field to index and Query to search for value of "OR" (Oregon state)?

Posted By:   Otis_Gospodnetic  
Posted On:   Saturday, August 28, 2004 01:35 AM

OR is the QueryParser's boolean operator, hence the problem. Construct your query programmatically, and you won't have problems. I also suggest you index state names as Field.Keyword, since there is no need to analyze the 2-letter abbreviation.
About | Sitemap | Contact