Sunburnt is behaving correctly; that Lucene query is a phrase search -
the spaces are escaped. The following two queries are exactly
equivalent in Lucene:
name:"united states of america"
name:united\ states\ of\ america
If you check, they should give the same result, they search for any
document containing the string of characters 'united states of
america' in the name field. This is different from:
name:united name:states name:of name:america
which would give the result you describe, or even worse:
name:united states of america
which would search for 'united' in the name field, and the words
'states', 'of', 'america' separately in the default search field.
Toby
The Lucene query language is frustratingly under-specified - my
experimentation had led me to believe that quotes or escaped strings
were entirely equivalent.
I found it considerably easier and more consistent to generate
appropriate strings by escaping them, rather than trying to write
logic for when double-quotes should be used, which is why I did it
this way. Maybe sunburnt should check for the status of the
autoGeneratePhraseQueries setting and bail out if it's not set
appropriately.
How did you run into this issue?
Toby