On Sun, Sep 11, 2011 at 12:56 PM, Mark juszczec <mark.juszc...@gmail.com> wrote: > We've also tried making it create > > field:a\ b > > The first case just does not work and I'm unsure why. > > The second case ends up url encoding the \ and I'm unsure if that will cause > it to be used in the query or not.
URL encoding is just part of the transfer syntax for an HTTP GET/POST - by the time the query makes it to the lucene/solr query parser, that escaping will have been removed. You can also use http://lucene.apache.org/solr/api/org/apache/solr/search/TermQParserPlugin.html and not worry about any escaping. But as Erick says, it's not clear that's really what you want (to search on a single term with a space in it). If it's a normal text field, each word will be indexed separately, so you really want a phrase query or a boolean query: field:"a b" or field:(a b) -Yonik http://www.lucene-eurocon.com - The Lucene/Solr User Conference