How to properly escape OR and AND in a lucene query?

When I sent “status: OR” in the query, Lutsen threw an error because he considered “OR” as a keyword for a logical sentence, but here I actually abbreviate the state of Oregon.

I saw that the quotation is OR, so the request becomes "state:" OR "" makes it work.

but this is not a very good approach, since I have to do line substitution for EACH of the keywords Lucene uses: AND OR NO and others ?? I'm not how much

I tried to build the query directly instead of doing queryParser.parse (), but it seems that this does not go through the parsers, which is a big problem.

+6
source share
2

, AND, OR NOT , :

\\AND \\OR \\NOT

,

+6

Lucene 3 - AND, OR NOT. ( "TO" , .)

, Lucene, (, "OR" ).

+3

All Articles