It depends on your use case. What is you custom criteria how is stored etc.


For example  I had two tables, lets say items and permissions tables. 
Permissions table was holding itemId,userId pairs. Meaning userId can see this 
itemId. My initial effort was index items and add a multivalued field named 
WhoCanSeeMe. And fiterQuery on that field using current user.

After sometime indexing become troublesome. Indexing was slowing down. I 
switched to two cores for each table and used query time join. (JoinQParser) as 
a fq. I didnt have anly plugin for the above.

By the way here is an example of post filter Joel advises : 
http://searchhub.org/2012/02/22/custom-security-filtering-in-solr/






On Monday, December 2, 2013 5:14 AM, Joel Bernstein <joels...@gmail.com> wrote:
 
What you're looking for is a QParserPlugin. Here is an example:

http://svn.apache.org/viewvc/lucene/dev/tags/lucene_solr_4_6_0/solr/core/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java?revision=1544545&view=markup

You're probably want to implement the QParserPlugin as PostFilter.




On Sun, Dec 1, 2013 at 3:46 PM, Thomas Seidl <re...@gmx.net> wrote:

> Hi,
>
> I'm currently looking at writing my first Solr plugin, but I could not
> really find any "overview" information about how a Solr request works
> internally, what the control flow is and what kind of plugins are available
> to customize this at which point. The Solr wiki page on plugins [1], in my
> opinion, already assumes too much knowledge and is too terse in its
> descriptions.
>
> [1] http://wiki.apache.org/solr/SolrPlugins
>
> If anyone knows of any good ressources to get me started, that would be
> awesome!
>
> However, also pretty helpful would be just to know what kind of plugin I
> should create for my use case, as I could then at least try to find
> information specific to that. What I want to do is filter the search
> results (at the time fq filters are applied, so before sorting, facetting,
> range selection, etc. takes place) by some custom criterion (passed in the
> URL). The plan is to add the data needed for that custom filter as a
> separate set of documents to Solr and look them up from the Solr index when
> filtering the query. Basically the thing discussed in [2], at 29:07.
>
> [2] http://www.youtube.com/watch?v=kJa-3PEc90g&feature=youtu.be&t=29m7s
>
> So, the question is, what kind of plugin would I use (and how would it
> have to be configured)? I first thought it'd have to be a SearchComponent,
> but I think with that I'd only get the results after they are sorted and
> trimmed to the range, right?
>
> Thanks a lot in advance,
> Thomas Seidl
>



-- 
Joel Bernstein
Search Engineer at Heliosearch

Reply via email to