Bast
Bast

Reputation: 671

Solr - fq bases

Just some generic questions about Filter Queries on solr (fq):

  1. Does a fq query cache all the potential results, or only the ones the query returns?

    e.g.: select?q=*:*&fq=bPublic:true&rows=10

    => with this query, if I have 60 millions of public documents, would it cache 10 or 60 millions of IDs?

  2. does it cache different result for the 2 following queries? (may be replied by the first question...):

    • select?q=*:*&fq=bPublic:true&rows=10
    • select?q=field:my_search&fq=bPublic:true&rows=10 <=> assuming here it only returns some of the documents
  3. does the Solr cache the IDs from filter Query in the OS cache or in java heap?

  4. Is the fq "executed" before or after the usual query (q)

    e.g.: select?title:"something really specific"&fq=bPublic:true&rows=10

    Would it first:

    • get all the "specific" results, and then apply the filter
    • OR is it first getting all the docs matching the fq and then running the "q" query

Thanks in advance.

kr, Bast

Upvotes: 0

Views: 57

Answers (1)

Bast
Bast

Reputation: 671

I got some answers from the solr mailing list:

  1. & 2. It stores every document in the core, with a bit (1 or 0) to store if it's matching the query.

  2. http://yonik.com/advanced-filter-caching-in-solr/ ==> fq queries are executed before the main q queries.

Upvotes: 0

Related Questions