Solr coding

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr coding

satya swaroop-2
Hi All,
          As for my project Requirement i need to keep privacy for search of
files so that i need to modify the code of solr,

for example if there are 5 users and each user indexes some files as
  user1 -> java1, c1,sap1
  user2 -> java2, c2,sap2
  user3 -> java3, c3,sap3
  user4 -> java4, c4,sap4
  user5 -> java5, c5,sap5

   and if a user2 searches for the keyword "java" then it should be display
only  the file java2 and not other files....

so inorder to keep this filtering inside solr itself may i know where to
modify the code... i will access a database to check the user indexed files
and then filter the result... i didnt have any cores.. i indexed all files
in a single index...

Regards,
satya
Reply | Threaded
Open this post in threaded view
|

Re: Solr coding

Jayendra Patil-2
Why not just add an extra field to the document in the Index for the
user, so you can easily filter out the results on the user field and
show only the documents submitted by the User.

Regards,
Jayendra

On Wed, Mar 23, 2011 at 9:20 AM, satya swaroop <[hidden email]> wrote:

> Hi All,
>          As for my project Requirement i need to keep privacy for search of
> files so that i need to modify the code of solr,
>
> for example if there are 5 users and each user indexes some files as
>  user1 -> java1, c1,sap1
>  user2 -> java2, c2,sap2
>  user3 -> java3, c3,sap3
>  user4 -> java4, c4,sap4
>  user5 -> java5, c5,sap5
>
>   and if a user2 searches for the keyword "java" then it should be display
> only  the file java2 and not other files....
>
> so inorder to keep this filtering inside solr itself may i know where to
> modify the code... i will access a database to check the user indexed files
> and then filter the result... i didnt have any cores.. i indexed all files
> in a single index...
>
> Regards,
> satya
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr coding

Sascha Szott
In reply to this post by satya swaroop-2
Hi,

depending on your needs, take a look at Apache ManifoldCF. It adds
document-level security on top of Solr.

-Sascha

On 23.03.2011 14:20, satya swaroop wrote:

> Hi All,
>            As for my project Requirement i need to keep privacy for search of
> files so that i need to modify the code of solr,
>
> for example if there are 5 users and each user indexes some files as
>    user1 ->  java1, c1,sap1
>    user2 ->  java2, c2,sap2
>    user3 ->  java3, c3,sap3
>    user4 ->  java4, c4,sap4
>    user5 ->  java5, c5,sap5
>
>     and if a user2 searches for the keyword "java" then it should be display
> only  the file java2 and not other files....
>
> so inorder to keep this filtering inside solr itself may i know where to
> modify the code... i will access a database to check the user indexed files
> and then filter the result... i didnt have any cores.. i indexed all files
> in a single index...
>
> Regards,
> satya
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr coding

satya swaroop-2
In reply to this post by Jayendra Patil-2
Hi Jayendra,
                I forgot to mention the result also depends on the group of
user too.... It is some wat complex so i didnt tell it.. now i explain the
exact way..

  user1, group1 -> java1, c1,sap1
  user2 ,group2-> java2, c2,sap2
  user3 ,group1,group3-> java3, c3,sap3
  user4 ,group3-> java4, c4,sap4
  user5 ,group3-> java5, c5,sap5

                             user1,group1 means user1 belong to group1


Here the filter includes the group too.., if for eg: user1 searches for
"java" then the results should show as java1,java3 since java3 file is
acessable to all users who are related to the group1, so i thought of to
edit the code...

Thanks,
satya
Reply | Threaded
Open this post in threaded view
|

Re: Solr coding

Jayendra Patil-2
In that case, you may want to store the groups as multivalued fields
who would have access to the document.
A filter query on the user group should have the results filtered as
you expect.

you may also check Apache ManifoldCF as suggested by Szott.

Regards,
Jayendra

On Wed, Mar 23, 2011 at 9:46 AM, satya swaroop <[hidden email]> wrote:

> Hi Jayendra,
>                I forgot to mention the result also depends on the group of
> user too.... It is some wat complex so i didnt tell it.. now i explain the
> exact way..
>
>  user1, group1 -> java1, c1,sap1
>  user2 ,group2-> java2, c2,sap2
>  user3 ,group1,group3-> java3, c3,sap3
>  user4 ,group3-> java4, c4,sap4
>  user5 ,group3-> java5, c5,sap5
>
>                             user1,group1 means user1 belong to group1
>
>
> Here the filter includes the group too.., if for eg: user1 searches for
> "java" then the results should show as java1,java3 since java3 file is
> acessable to all users who are related to the group1, so i thought of to
> edit the code...
>
> Thanks,
> satya
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr coding

satya swaroop-2
Hi Jayendra,
                  the group field can be kept if the no. of groups are
small... if a user may belong to 1000 groups in that case it would be
difficult to make a query???,   if a user changes the groups then we have to
reindex the data again...

ok i will try ur suggestion, if it can fulfill the needs then task will be
very easy...

Regards,
satya