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 Steven White <sw...@gmail.com> on 2015/03/31 20:25:40 UTC
Filtering in Solr
Hi folks,
I need filtering capability just as described here for Lucene:
http://www.javaranch.com/journal/2009/02/filtering-a-lucene-search.html
"Filtering is a mechanism of narrowing the search space, allowing only a
subset of the documents to be considered as possible hits. They can be used
to implement search-within-search features to successively search within a
previous set of results *or to constrain the document search space for
security or external data reasons.* A security filter is a powerful
example, *allowing users to only see search results of documents they own
even if their query technically matches other documents that are off
limits;* we provide an example of a security filter in the section
"Security filters".
How do I get this behavior using Solr?
If there is an example, that's great.
Thanks
Steve
Re: Filtering in Solr
Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/31/2015 12:25 PM, Steven White wrote:
> I need filtering capability just as described here for Lucene:
> http://www.javaranch.com/journal/2009/02/filtering-a-lucene-search.html
>
> "Filtering is a mechanism of narrowing the search space, allowing only a
> subset of the documents to be considered as possible hits. They can be used
> to implement search-within-search features to successively search within a
> previous set of results *or to constrain the document search space for
> security or external data reasons.* A security filter is a powerful
> example, *allowing users to only see search results of documents they own
> even if their query technically matches other documents that are off
> limits;* we provide an example of a security filter in the section
> "Security filters".
>
> How do I get this behavior using Solr?
https://wiki.apache.org/solr/CommonQueryParameters#fq
https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-Thefq%28FilterQuery%29Parameter
Both of these include an explanation and examples.
The user-editable wiki talks about caching quite a lot, because when a
filter comes from the cache instead of being executed, it can REALLY
make things go faster.
Thanks,
Shawn