Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-678

SolrYard needs to quote search terms like "OR" "AND" "NOT"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • entityhub-0.11.0
    • Entityhub
    • 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.

      Attachments

        Activity

          People

            rwesten Rupert Westenthaler
            rwesten Rupert Westenthaler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: