This is a query _parsing_ issue, way before a tokenizer ever gets to
it. The problem of course is that AND is an operator in the query
language, so your problem is how to distinguish it from the value of a
field.

You can always quote the input for id, as in id:"AND" which you could
do for everything you put in that field. You'll have he same problem
with OR and NOT BTW.

Best,
Erick
On Tue, Sep 4, 2018 at 3:10 AM girish.vignesh <girish.vign...@gmail.com> wrote:
>
> One of the ID attribute which we are using to query is AND so our looks like
>
> http://localhost:8983/solr//select?fq=id:AND&wt=json
>
> This throws below mentioned exception
>
> error: { metadata: [ "error-class", "org.apache.solr.common.SolrException",
> "root-error-class", "org.apache.solr.parser.ParseException" ], msg:
> "org.apache.solr.search.SyntaxError: Cannot parse 'id:AND': Encountered "
> "AND "" at line 1
>
> I can escape AND by using below mentioned queries
> http://localhost:8983/solr//select?fq=entityId:\AND&wt=json
> http://localhost:8983/solr//select?fq=entityId:%22AND%22&wt=json
>
> Question: I do not want to handle this while making a query. Is there any
> other way to handle this at Solr config level using tokenizer or some other
> way. This way I do not have to handle this at multiple places.
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Reply via email to