0

I have following fields for my solr collection

Fields :

  • projectid
  • folderid
  • fileid
  • filename

I want to search particular file based on projectid & folderid

Which one gives more performance using

1)

q:projectid:(PROJECTID) AND folderid:(FOLDERID)

OR
2)

q:projectid:(PROJECTID)

fq:(folderid:FOLDERID)

Thanks for looking here,

mcacorner
  • 1,304
  • 3
  • 22
  • 45

2 Answers2

0

Using fq in your query will be faster than using a regular q parameter.

nick_v1
  • 1,654
  • 1
  • 18
  • 29
0

Filter Query can be very useful for speeding up complex queries since the queries specified with fq are cached independently from the main query. Caching means the same filter is used again for a later query (i.e. there's a cache hit).For caching see:http://wiki.apache.org/solr/SolrCaching.

The local param cache=false can be added at the top-level of any filter query, and cause that filter to not be generated up front and cached, but instead executed in parallel with the query and all other filters. This can be beneficial for filters that will not be reused in other requests (thus avoiding polluting the filterCache) and for filters that are very expensive to evaluate for every document in the index.

Example: q:projectid:123&fq={!cache=false}folderid:FOLDERID

Check out this to have more information :http://wiki.apache.org/solr/CommonQueryParameters

Alok Chaudhary
  • 3,481
  • 1
  • 16
  • 19