Hi,

using filterQuery(fq) is more efficient because SolrIndexSearcher will make use 
of filterCache
and in your case it returns entire set from the cache instead of searching from 
the entire index.

more info about solrCaches at 
http://wiki.apache.org/solr/SolrCaching#filterCache


Regards, 
P.N.Raju,




________________________________
From: gabriele renzi <rff....@gmail.com>
To: solr-user@lucene.apache.org
Sent: Tue, February 16, 2010 11:54:24 AM
Subject: Query or FilterQuery for exact field match

Hi everyone,

in our app we sometimes use solr programmatically to retrieve all the
elements that have a certain value in a single-valued single-token
field ( brand:xxx).
Since we are not interested in scoring this results, I was thinking
that maybe this should be performed as a filterQuery (fq="brand:xxx"),
and in that case I guess I shall be using a wildcard for the  query
(q="*:*"), as I'd get an NPE on the missing parameter otherwise.

Does something like this even make sense? Is there a proper way to do
a query like this, or is the normal route of using q=brand:xxx already
the best way?

Thanks in advance for any answer.


-- 
blog en: http://www.riffraff.info
blog it: http://riffraff.blogsome.com



      

Reply via email to