--- On Fri, 10/23/09, Dan A. Dickey <dan.dic...@savvis.net> wrote:
> From: Dan A. Dickey <dan.dic...@savvis.net> > Subject: help with how to search using spaces in the query for string > fields... > To: solr-user@lucene.apache.org > Date: Friday, October 23, 2009, 5:12 PM > I'm having a problem with figuring > out how to search for things > that have spaces (just a single space character) in them. > For example, I have a field named "FileName" and it is of > type string. > I've indexed a couple of documents, that have field > FileName > equal to "File 10 10AM" and another that has FileName "File > 11 11AM". > In my search query, I'm trying "Filename:(File 1*)" and I'd > like to it > return both documents. It return none. > If I search for "Filename:(File*)" I get both of them and > everything else. > I've tried lots of different ways to form the query, but > the only thing > that returns any documents is the "FileName:(File*)" > form. Anything > else with an actual space in it fails. > This has got to be another simple thing that I'm missing, > but haven't > figured it out yet nor stumbled upon the correct search > query. > Help please! The above scenario is an example, but I > am using > the string field type. > -Dan You need to escape space. Try this one : Filename:(File\ 1*)