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 GTHell <so...@gmail.com> on 2020/03/13 12:15:04 UTC

Should I index the field that use in fq field?

I'm doing a lot of filter query in fq. My search is something like
'q=*:*&fq=..function on a few fields..' . Do I need to only index those
field and use FL to get other result or do I need to index everything?



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Should I index the field that use in fq field?

Posted by Erick Erickson <er...@gmail.com>.
This isn’t quite right. The fields do _not_ need indexed=true if (and only if) they
have docValues=true in order to use function queries. But it’ll consume lots of
on-heap resources.

In fact, depending on the version of Solr (which you have not told us), it’s even
possible to search on a field with docValues=true indexed=false. But it’s extremely
inefficient.

Which causes you problems when you extrapolate from small data sets to
production. Something that works fine with 100K docs blows up when you
start putting 10M docs in.

So here’s the rule, for efficiency (both run-time and memory):

1> indexed=“true” for anything you search on. I.e. q=field:value or even fq=field:value
2> docValues=“true” for anything you use for function queries, sorting, grouping, or faceting.

Of course you can specify both for any given field.

Best,
Erick


> On Mar 13, 2020, at 8:29 AM, Nicolas Franck <Ni...@UGent.be> wrote:
> 
> Yes,
> 
> every field you query has to be "indexed"
> 
> every field you need to be returned in the response has to be "stored"
> 
> the parameter "fl" can only return fields that are "stored". Other fields
> given are simply ignored.
> 
> 
> 
>> On 13 Mar 2020, at 13:15, GTHell <so...@gmail.com> wrote:
>> 
>> I'm doing a lot of filter query in fq. My search is something like
>> 'q=*:*&fq=..function on a few fields..' . Do I need to only index those
>> field and use FL to get other result or do I need to index everything?
>> 
>> 
>> 
>> --
>> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html
> 


Re: Should I index the field that use in fq field?

Posted by Erick Erickson <er...@gmail.com>.
FL has two flavors, neither of them have to do with index=true|false.

To return a field in the FL list, specify stored=“true”.

To return the results of a _function_, you can do that with “pseudo-fields”, please look in the reference guide.

Best,
Erick


> On Mar 13, 2020, at 8:42 AM, GTHell <so...@gmail.com> wrote:
> 
> Does it mean that if the FL field is the result of some function, do I need
> to only Index those fields right? Or do I need to stored it also?
> 
> 
> 
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Should I index the field that use in fq field?

Posted by GTHell <so...@gmail.com>.
Does it mean that if the FL field is the result of some function, do I need
to only Index those fields right? Or do I need to stored it also?



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Should I index the field that use in fq field?

Posted by Nicolas Franck <Ni...@UGent.be>.
Yes,

every field you query has to be "indexed"

every field you need to be returned in the response has to be "stored"

the parameter "fl" can only return fields that are "stored". Other fields
given are simply ignored.



> On 13 Mar 2020, at 13:15, GTHell <so...@gmail.com> wrote:
> 
> I'm doing a lot of filter query in fq. My search is something like
> 'q=*:*&fq=..function on a few fields..' . Do I need to only index those
> field and use FL to get other result or do I need to index everything?
> 
> 
> 
> --
> Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html