Hi,

It looks like the query parser is doing its job of removing certain characters 
from the query string.

Maybe you can use this method directly or at least mimic it in your application:

./src/solrj/org/apache/solr/client/solrj/util/ClientUtils.java:  public static 
String escapeQueryChars(String s) {


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Avlesh Singh <avl...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Monday, June 15, 2009 8:06:03 AM
> Subject: Problem with Query Parser?
> 
> I noticed a strange behavior of the Query parser for the following query on
> my index.
> +(category_name:"$" product_name:"$" brand_name:"$") +is_available:1
> Fields, category_name, product_name and brand_name are of type "text" and
> is_available is a "string" field, storing 0 or 1 for each doc in the index.
> 
> When I perform the query: *+(category_name:"$" product_name:"$"
> brand_name:"$")*, i get no results (which is as expected);
> However, when I perform the query: *+(category_name:"$" product_name:"$"
> brand_name:"$") +is_available:1*, I get results for all is_available=1. This
> is unexpected and undesired, the first half of the query is simply ignored.
> 
> I have noticed this behaviour for pretty much all the special characters: $,
> ^, * etc ... I am using the default text field analyzer.
> Am I missing something or is this a known bug in Solr?
> 
> Cheers
> Avlesh

Reply via email to