On Mar 26, 2007, at 7:52 AM, Thierry Collogne wrote:

Hello,

I have a field "sitename" that can contain a word with & character, "HR &
O".
Problem is when I do the following query : sitename:HR & O, I get search
results that don't have HR & O in the sitename field.

Is it possible that there is a problem when performing queries containg &?

First, on troubleshooting... add &debugQuery=true to your request to Solr and see how your query parses. You'll see output sorta like this (example using wt=ruby):

  'rawquerystring'=>'(tang)',
  'querystring'=>'\\(tang\\)',
'parsedquery'=>'+DisjunctionMaxQuery((text:tang^1.9)~0.01) DisjunctionMaxQuery((title_text:tang^2.2 | isbn_text:tang^5.0 | author_text:tang^0.5 | call_number_text:tang^5.0)~0.01)', 'parsedquery_toString'=>'+(text:tang^1.9)~0.01 (title_text:tang^2.2 | isbn_text:tang^5.0 | author_text:tang^0.5 | call_number_text:tang^5.0)~0.01',

Possible solutions for you:

  - sitename:(HR & O)

OR

  - sitename:"HR & O"

Depending on how you're analyzing (or not) that field.

        Erik

Reply via email to