lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxkmailbox...@yahoo.com
Subject Re: filter query error
Date Wed, 27 Jan 2010 21:49:49 GMT


thanks! that worked.



________________________________
From: Ahmet Arslan <iorixxx@yahoo.com>
To: solr-user@lucene.apache.org
Sent: Wed, January 27, 2010 2:00:32 PM
Subject: Re: filter query error

> I am trying to use a filter query that filters on more than
> one value for a given filter  ie. filters on field
> equals value1 or value2
> 
> If I enter the following 2 urls in a browser I get back the
> correct results I am looking for:
> 
> http://localhost:8080/apache-solr-1.4.0/select/?q=help&fl=*,score&fq=+searchScope:SRM+searchScope:SMN&indent=on
> or
> http://localHost:8080/apache-solr-1.4.0/select/?q=help&fl=*,searchScope,score&fq=searchScope:(SRM+OR+SMN)&indent=on
> 
> But when I try to do it programitically I get an
> error.  It only works when I am filtering on 1 value,
> but when I try more than one value it fails.
> See code snippet  and error message below.  When
> I use filter2 or filter3 it fails, but filter1 gives me no
> Errors
> 
> Not sure what I am doing wrong.  Any help would be
> greatly appreciated.
> 
> -----Begin Code snippet ---
> String query = "help";
> 
> //String filter1 = "searchScope:SRM
> //String filter2 = "+searchScope:SRM+searchScope:SMN";
> String filter3 = "searchScope:(SRM+OR+SMN)";
> 

You need to replace + with space: 
String filter3 = "searchScope:(SRM OR SMN)"; should work.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message