using fq means no results

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

using fq means no results

rhys J
If I do this query in the browser:

http://10.40.10.14:8983/solr/debt/select?q=(clt_ref_no:+owl-2924-8)^=1.0+clt_ref_no:owl-2924-8

I get 84662 results.

If I do this query:

http://10.40.10.14:8983/solr/debt/select?q=(clt_ref_no:+owl-2924-8)^=1.0+clt_ref_no:owl-2924-8&fq=clt_ref_no

I get 0 results.

Why does using fq do this?

What am I missing in my query?

Thanks,

Rhys
Reply | Threaded
Open this post in threaded view
|

Re: using fq means no results

Erik Hatcher-4
fq is a filter query, and thus narrows the result set provided by the q down to what also matches all specified fq's.

You gave it a query, "cat_ref_no", which literally looks for that string in your default field.   Looking at your q parameter, cat_ref_no looks like a field name, and your fq should probably also have a value for that field (say fq=cat_ref_no=owl-2924-8)

Use debug=true to see how your q and fq's are parsed, and that should shed some light on the issue.

        Erik


> On Nov 12, 2019, at 11:33 AM, rhys J <[hidden email]> wrote:
>
> If I do this query in the browser:
>
> http://10.40.10.14:8983/solr/debt/select?q=(clt_ref_no:+owl-2924-8)^=1.0+clt_ref_no:owl-2924-8
>
> I get 84662 results.
>
> If I do this query:
>
> http://10.40.10.14:8983/solr/debt/select?q=(clt_ref_no:+owl-2924-8)^=1.0+clt_ref_no:owl-2924-8&fq=clt_ref_no
>
> I get 0 results.
>
> Why does using fq do this?
>
> What am I missing in my query?
>
> Thanks,
>
> Rhys

Reply | Threaded
Open this post in threaded view
|

Re: using fq means no results

rhys J
On Tue, Nov 12, 2019 at 11:57 AM Erik Hatcher <[hidden email]>
wrote:

> fq is a filter query, and thus narrows the result set provided by the q
> down to what also matches all specified fq's.
>
>
So this can be used instead of scoring? Or alongside scoring?


> You gave it a query, "cat_ref_no", which literally looks for that string
> in your default field.   Looking at your q parameter, cat_ref_no looks like
> a field name, and your fq should probably also have a value for that field
> (say fq=cat_ref_no=owl-2924-8)
>
> Use debug=true to see how your q         and fq's are parsed, and that
> should shed some light on the issue.
>
>
Thank you for your help!

Rhys
Reply | Threaded
Open this post in threaded view
|

Re: using fq means no results

Erik Hatcher-4


> On Nov 12, 2019, at 12:01 PM, rhys J <[hidden email]> wrote:
>
> On Tue, Nov 12, 2019 at 11:57 AM Erik Hatcher <[hidden email]>
> wrote:
>
>> fq is a filter query, and thus narrows the result set provided by the q
>> down to what also matches all specified fq's.
>>
>>
> So this can be used instead of scoring? Or alongside scoring?

That's right.   Only `q` (and it's query parser associated params) are used for scoring.   fq's narrow the result set, but don't influence score.

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: using fq means no results

Walter Underwood
I explain it this way:

* fq: filtering
* q: filtering and scoring
* bq: scoring

wunder
Walter Underwood
[hidden email]
http://observer.wunderwood.org/  (my blog)

> On Nov 12, 2019, at 9:08 AM, Erik Hatcher <[hidden email]> wrote:
>
>
>
>> On Nov 12, 2019, at 12:01 PM, rhys J <[hidden email]> wrote:
>>
>> On Tue, Nov 12, 2019 at 11:57 AM Erik Hatcher <[hidden email]>
>> wrote:
>>
>>> fq is a filter query, and thus narrows the result set provided by the q
>>> down to what also matches all specified fq's.
>>>
>>>
>> So this can be used instead of scoring? Or alongside scoring?
>
> That's right.   Only `q` (and it's query parser associated params) are used for scoring.   fq's narrow the result set, but don't influence score.
>
> Erik
>

Reply | Threaded
Open this post in threaded view
|

Re: using fq means no results

Erik Hatcher-4
To add bq in there makes it query parser specific.  But I’m being pedantic since most folks are using edismax where that applies (along with a bunch of other params that would also deserve mention, like boost and bf).  q and fq, agreed for the explanation.  bq mentioned only if specifics and siblings described too :)

> On Nov 12, 2019, at 12:16, Walter Underwood <[hidden email]> wrote:
>
> I explain it this way:
>
> * fq: filtering
> * q: filtering and scoring
> * bq: scoring
>
> wunder
> Walter Underwood
> [hidden email]
> http://observer.wunderwood.org/  (my blog)
>
>>> On Nov 12, 2019, at 9:08 AM, Erik Hatcher <[hidden email]> wrote:
>>>
>>>
>>>
>>>> On Nov 12, 2019, at 12:01 PM, rhys J <[hidden email]> wrote:
>>>
>>> On Tue, Nov 12, 2019 at 11:57 AM Erik Hatcher <[hidden email]>
>>> wrote:
>>>
>>>> fq is a filter query, and thus narrows the result set provided by the q
>>>> down to what also matches all specified fq's.
>>>>
>>>>
>>> So this can be used instead of scoring? Or alongside scoring?
>>
>> That's right.   Only `q` (and it's query parser associated params) are used for scoring.   fq's narrow the result set, but don't influence score.
>>
>>    Erik
>>
>