You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ganesh <em...@yahoo.co.in> on 2008/11/21 05:58:45 UTC

Filter or Query

Hello all,

I am planning to use Filter for UserID and Date. I will not be able to cache 
the Filter. I have to create this filter for every request. To my knowledge, 
Filter will give faster results, only if it is cached.

Is it a good idea to use a filter or better to use query?

Regards
Ganesh

Send instant messages to your online friends http://in.messenger.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Filter or Query

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Nov 20, 2008, at 11:58 PM, Ganesh wrote:

> I am planning to use Filter for UserID and Date. I will not be able  
> to cache the Filter. I have to create this filter for every request.  
> To my knowledge, Filter will give faster results, only if it is  
> cached.
>
> Is it a good idea to use a filter or better to use query?

If you use filter queries (fq) in this manner, you will be caching the  
results, and this could have a negative impact on faceting performance  
if you bump facet field/query entries out of the cache.

Having uncached filter queries would be a good idea: <https://issues.apache.org/jira/browse/SOLR-407 
 >

But for now, you could simply append your "filter" to the original  
query string (unless you're using dismax and need a sophisticated  
clause).

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org