Stanbol
  1. Stanbol
  2. STANBOL-678

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: entityhub-0.11.0
    • Component/s: Entityhub
    • Labels:
      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.

        Activity

        Hide
        Rupert Westenthaler added a comment -

        fixed with revision 1359206 in the trunk and then entityhub.0.10 branch

        Show
        Rupert Westenthaler added a comment - fixed with revision 1359206 in the trunk and then entityhub.0.10 branch

          People

          • Assignee:
            Rupert Westenthaler
            Reporter:
            Rupert Westenthaler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development