hi, use the filter LowerCaseFilterFactory (don't work with string type, you must create a new fieldtype of text type)
or use scaped forms: \OR \AND I tried it a moment ago and it works. saludos --- Rode González > -----Mensaje original----- > De: Tomás Fernández Löbbe [mailto:tomasflo...@gmail.com] > Enviado el: jueves, 11 de agosto de 2011 19:58 > Para: solr-user@lucene.apache.org > Asunto: Re: Searching For Term 'OR' > > I guess this is because Lucene QP is interpreting the 'OR' operator. > You can either: > use lowercase > use other query parser, like the term query parser. See > http://lucene.apache.org/solr/api/org/apache/solr/search/TermQParserPlu > gin.html > > Also, if you just removed the "or" term from the stopwords, you'll > probably > have to reindex if you want it in the index. > > Regards, > > Tomás > > On Thu, Aug 11, 2011 at 2:38 PM, John Brewer > <john.bre...@atozdatabases.com>wrote: > > > Hello, > > > > I am looking for some advice on how to index and search a field that > > contains a two character state name without the query parser dying on > the OR > > and also not treating it as an 'OR' Boolean operator. > > > > For example: > > > > The following query with a filter query key/value pair causes an > > exception: > > > > q=*:*&fq=(state:OR) > > > > Caused by: org.apache.lucene.queryParser.ParseException: Encountered > " <OR> > > "OR "" at line 1, column 7. > > Was expecting one of: > > "(" ... > > "*" ... > > <QUOTED> ... > > <TERM> ... > > <PREFIXTERM> ... > > <WILDTERM> ... > > "[" ... > > "{" ... > > <NUMBER> ... > > > > Note: we had the same issue with Indiana (IN), but removing that > stop word > > fixed it. Removing the stopword 'or', has not helped. > > > > The field itself is indexed and stored as string field during > indexing. > > <field name="state" type="string" indexed="true" stored="true"/> > > > > > > Thanks in advance, > > John Brewer > > > > > > ----- > No se encontraron virus en este mensaje. > Comprobado por AVG - www.avg.com > Versión: 10.0.1392 / Base de datos de virus: 1520/3827 - Fecha de > publicación: 08/11/11 ----- No se encontraron virus en este mensaje. Comprobado por AVG - www.avg.com Versión: 10.0.1392 / Base de datos de virus: 1520/3827 - Fecha de publicación: 08/11/11