Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Queries for keywords used by Solr do create exceptions like
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse '(((@de/skos\:prefLabel/:MVVM)) OR ((@/skos\:prefLabel/:MVVM)) OR ((@de/skos\:prefLabel/:OR)) OR ((@/skos\:prefLabel/:OR)))': Encountered " <OR> "OR "" at line 1, column 88.
Was expecting one of:
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:211)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:80)
[...]
Even that I can not find in the documentation that one needs to quote queries like
field:OR
field:AND
.. possible other ..
quoting those
field:"OR"
solves those.
As there is no disadvantage in quoting all field values that do not contain wildcards the best solution seams to be to quote them all.
NOTE: that the SolrYard already treats queries and tokens that use wildcard chars differently.