Lucene - Core
  1. Lucene - Core
  2. LUCENE-1122

queryparser whitespace escaping and documentation?

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      as noted in this solr thread...

      http://www.nabble.com/PhraseQuery-and-WildcardQuery-to14503609.html#a14503609

      ...it's possible to escape a whitespace character in the value of a term or prefix query by using a backslash so that the QueryParser will not treat it as "special" (ie: won't split on it when dividing the input into chunks for analysis).

      at a minimum, this should be noted here...

      http://lucene.apache.org/java/docs/queryparsersyntax.html#Escaping%20Special%20Characters

      ...but it got me wondering...

      • is this a side effect of something else, or will QueryParser really respect this everywhere? even in field names? (i haven't tested) ... i think this is a result of QueryParser allowing you to escape any character even if it isn't "special" to the syntax
      • shouldn't a space be considered "special" since it does trigger certain behavior? ... so shouldn't QueryParser.escape(String) escape spaces as well as the other special characters?

        Issue Links

          Activity

          Hoss Man created issue -
          Hoss Man made changes -
          Field Original Value New Value
          Link This issue relates to LUCENE-1000 [ LUCENE-1000 ]
          Mark Miller made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Mark Thomas made changes -
          Workflow jira [ 12420402 ] Default workflow, editable Closed status [ 12563018 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12563018 ] jira [ 12584056 ]
          Erick Erickson made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development