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 Valiveti <na...@gmail.com> on 2011/01/25 18:07:36 UTC

How to Configure Solr to pick my lucene custom filter

Hi ,

I have written a lucene custom filter.
I could not figure out on how to configure Solr to pick this custom filter
for search.

How to configure Solr to pick my custom filter?
Will the Solr standard search handler pick this custom filter?

Thanks,
Valiveti

-- 
View this message in context: http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2331928.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to Configure Solr to pick my lucene custom filter

Posted by Valiveti <na...@gmail.com>.
We thought of using "fq". But that seems not to suit our scenario. 

Both denial and Grant access permissions are stored on the documnet as
rules.

The order of the rules also need to be considered.
We might have a huge list of values for the ACL field. Each value is
considered to be a rule.
Sample:
<doc>
      <field name="ACL">-Group(X)</field>
      <field name="ACL">+Group(Y)</field>
      <field name="ACL">[Condition]+Group(Z)</field>
      .........
</doc>

The documnet access should be denied for the users who belong to Grop X  .
User who belong to Group Y should be provided access.

If a user who belongs to group Z gets this document during the search since
the first two rules does not match it proceeds to the third rule. Where the
condition will be evaluated based on certain inputs provided to the filter
and if that condition is met then the user will be granted access.

This is just an example. We have many more different rules defined.

So thought of having a filter that can get hold of this rules and process.

Note: The rules are not same for all documents.

Thanks,
Valiveti




-- 
View this message in context: http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2357828.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to Configure Solr to pick my lucene custom filter

Posted by Erick Erickson <er...@gmail.com>.
Ah, ok. We were talking about different things. Filters is kind of
overloaded in Solr/lucene, it's easy to be confused.

No, you do not have to deal with analyzers or tokenfilters in your scenario.

But let's back up a bit here. How are permissions for documents stored?
Because if there's an identifier in the document indicating the user has
access (say a role-based permission scheme with a relatively small
number of auth tokens, say less than a few hundred), you don't need
to write any custom code at all, simply append &fq=auth_token_field:(tok1
tok2, tok3)
to the query.

This isn't a good solution if the users have permissions set on individual
documents though since the fq clause could potentially be very, very, very
large.

So let's delve into the problem before deciding on a solution, this may be
an XY problem.

Best
Erick

On Wed, Jan 26, 2011 at 10:48 AM, Valiveti <na...@gmail.com>wrote:

>
> I am new to using Solr and lucene.
>
> I wrote a custom filter.
>
> The logic is build based on a multi field value of the document found. Only
> the documents that the user has read access should be returned back.
>
> I would like this custom filter to be used during search and filter out the
> documnets.
>
> Is there a way that this filter can be configured to the default search
> handlers to be picked during search?
>
> I havent written any analyzers or tokenfilters. Are they needed for this
> scenario?
>
> Thanks,
> Valiveti
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2354772.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to Configure Solr to pick my lucene custom filter

Posted by Valiveti <na...@gmail.com>.
I am new to using Solr and lucene.

I wrote a custom filter. 

The logic is build based on a multi field value of the document found. Only
the documents that the user has read access should be returned back.

I would like this custom filter to be used during search and filter out the
documnets.

Is there a way that this filter can be configured to the default search
handlers to be picked during search?

I havent written any analyzers or tokenfilters. Are they needed for this
scenario?

Thanks,
Valiveti
-- 
View this message in context: http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2354772.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to Configure Solr to pick my lucene custom filter

Posted by Erick Erickson <er...@gmail.com>.
First, let's be sure we're talking about the same thing. My response was for
adding
a filter to your analysis chain for a field in Schema.xml. Are you talking
about a different
sort of filter?

Best
Erick

On Tue, Jan 25, 2011 at 4:09 PM, Valiveti <na...@gmail.com>wrote:

>
> Hi Eric,
>
> Thanks for the reply.
>
> I Did see some entries in the solrconfig.xml for adding custom
> reposneHandlers, queryParsers and queryResponseWriters.
>
> Bit could not find the one for adding the custom filter.
>
> Could you point to the exact location or syntax to be used.
>
> Thanks,
> Valiveti
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2334120.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to Configure Solr to pick my lucene custom filter

Posted by Valiveti <na...@gmail.com>.
Hi Eric,

Thanks for the reply.

I Did see some entries in the solrconfig.xml for adding custom
reposneHandlers, queryParsers and queryResponseWriters.

Bit could not find the one for adding the custom filter.

Could you point to the exact location or syntax to be used.

Thanks,
Valiveti


-- 
View this message in context: http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2334120.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to Configure Solr to pick my lucene custom filter

Posted by Erick Erickson <er...@gmail.com>.
Presumably your custom filter is in a jar file. Drop that jar file in
<solr_home>/lib
and refer it from your schema.xml file by its full name
(e.g. com.yourcompany.filter.yourcustomfilter) just like the other filters
and it should
work fine.

You can also put your jar anywhere you'd like and alter solrconfig.xml with
an
addition al <lib... tag in the <config> section (see the example
solrconfig.xml).

Best
Erick

On Tue, Jan 25, 2011 at 12:07 PM, Valiveti <na...@gmail.com>wrote:

>
> Hi ,
>
> I have written a lucene custom filter.
> I could not figure out on how to configure Solr to pick this custom filter
> for search.
>
> How to configure Solr to pick my custom filter?
> Will the Solr standard search handler pick this custom filter?
>
> Thanks,
> Valiveti
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-Configure-Solr-to-pick-my-lucene-custom-filter-tp2331928p2331928.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>