You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by jyn7 <jy...@gmail.com> on 2011/06/24 16:27:29 UTC

Query Results Differ

Hi,

I am trying to understand why the two queries return different results. To
me they look similar, can some one help me understand the difference in the
results.

Query1 :
facet=true&q=time&fq=supplierid:1001&start=0&rows=10&sort=published_on desc

Query2: facet=true&q=time&fq=supplierid:1001+published_on:[* TO
NOW]&start=0&rows=10&sort=published_on desc

The first query returns only 44 rows while the second one returns 200,000
rows. When I dont have the filter for published_on, I am assuming that SOLR
should return all the results with supplier id 1001, so Query 1 should have
returned more number of results(or atleast same number of results ) than the
second query.  

Thanks.





--
View this message in context: http://lucene.472066.n3.nabble.com/Query-Results-Differ-tp3104412p3104412.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query Results Differ

Posted by jyn7 <jy...@gmail.com>.
Thanks Stefan.

--
View this message in context: http://lucene.472066.n3.nabble.com/Query-Results-Differ-tp3104412p3105914.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query Results Differ

Posted by Stefan Matheis <ma...@googlemail.com>.
On Fri, Jun 24, 2011 at 5:11 PM, jyn7 <jy...@gmail.com> wrote:
> So if I use a second fq parameter, will SOLR apply an AND on both the fq
> parameters?

Yes :)

On Fri, Jun 24, 2011 at 5:11 PM, jyn7 <jy...@gmail.com> wrote:
> I have multiple indexed values, so when I search for q=time, does SOLR
> return results with Time in any of the indexed values ? Sorry for the silly
> questions

No. Read here http://wiki.apache.org/solr/SchemaXml#The_Default_Search_Field
and afterwards here http://wiki.apache.org/solr/SchemaXml#Copy_Fields

Regards
Stefan

Re: Query Results Differ

Posted by jyn7 <jy...@gmail.com>.
So if I use a second fq parameter, will SOLR apply an AND on both the fq
parameters?
I have multiple indexed values, so when I search for q=time, does SOLR
return results with Time in any of the indexed values ? Sorry for the silly
questions


--
View this message in context: http://lucene.472066.n3.nabble.com/Query-Results-Differ-tp3104412p3104611.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query Results Differ

Posted by Stefan Matheis <ma...@googlemail.com>.
+ is an urlencoded whitespace .. so your filter-query says either
supplerid or published_on.

what you could do is:
1) use a second fq= param
2) combine them both into one like this: fq=foo+%2Bbar

%2B is an urlencoded + character

HTH, Regards
Stefan

On Fri, Jun 24, 2011 at 4:27 PM, jyn7 <jy...@gmail.com> wrote:
> Hi,
>
> I am trying to understand why the two queries return different results. To
> me they look similar, can some one help me understand the difference in the
> results.
>
> Query1 :
> facet=true&q=time&fq=supplierid:1001&start=0&rows=10&sort=published_on desc
>
> Query2: facet=true&q=time&fq=supplierid:1001+published_on:[* TO
> NOW]&start=0&rows=10&sort=published_on desc
>
> The first query returns only 44 rows while the second one returns 200,000
> rows. When I dont have the filter for published_on, I am assuming that SOLR
> should return all the results with supplier id 1001, so Query 1 should have
> returned more number of results(or atleast same number of results ) than the
> second query.
>
> Thanks.
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Query-Results-Differ-tp3104412p3104412.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>