lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan McKinley <>
Subject edismax with windows path input?
Date Thu, 10 Feb 2011 19:36:05 GMT
I am using the edismax query parser -- its awesome!  works well for
standard dismax type queries, and allows explicit fields when

I have hit a snag when people enter something that looks like a windows path:
<lst name="params">
 <str name="q">F:\path\to\a\file</str>
this gets parsed as:
<str name="rawquerystring">F:\path\to\a\file</str>
<str name="querystring">F:\path\to\a\file</str>
<str name="parsedquery">+()</str>

Putting it in quotes makes the not-quite right query:
<str name="rawquerystring">"F:\path\to\a\file"</str>
<str name="querystring">"F:\path\to\a\file"</str>
<str name="parsedquery">
+DisjunctionMaxQuery((path:f:pathtoafile^4.0 | name:"f (pathtoafile
<str name="parsedquery_toString">
+(path_path:f:pathtoafile^4.0 | name:"f (pathtoafile fpathtoafile)"^7.0)~0.01

Telling people to escape the query:
is unrealistic, but gives the proper parsed query:

+DisjunctionMaxQuery((path_path:f:/path/to/a/file^4.0 | name:"f path
to a (file fpathtoafile)"^7.0)~0.01)

Any ideas on how to support this?  I could try looking for things like
paths in the app, and then modify the query, or maybe look at
extending edismax.  Perhaps when F: does not match a given field, it
could auto escape the rest of the word?


View raw message