Content privacy, search & index

2012-03-31 Thread dbenjamin
Hi,

I'm relatively new to Solr, new in the way that i already used Solr several
times but always with a very simple approach, meaning simple fulltext search
with faceting and filtering.

Today, i've to go a bit further and before i do, i'd like to get your point
of view ;-)

I need to index users and user contents that are subject to privacy levels
like for instance :

* Anyone
* Only me
* Only my friends
* Only people i choose

...really classic.

So, when an user searches for contents on the website, in the results, we
can't show him the content elements he is not allowed to see.

My first thought was : "There might be a way to do that with complex solr
queries"

So i start reading the documentation, and i have to say that i understand
half of the things i read :-)

And then, a new idea came to my mind. I was thinking about this process :

1- The user submits the search form with his keywords
2- I prepare a classic fulltext search query
3- I compute some way the friend list of the current user
4- I add a filter to the Solr query with the result of that
5- I send the query

While this seems reasonable since i can add some cache system in the way to
avoid computing the friend list each time, i don't know why, it doesn't feel
right ;-)

The other way would be to index users and users friends and somehow letting
solr doing all the job.

What do you think ? Is the second solution even possible ?


Thanks !
Br,

Benjamin.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Content-privacy-search-index-tp3873462p3873462.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Content privacy, search & index

2012-03-31 Thread dbenjamin
Hi Erick and thanks for the quick reply.

Well, my intend would not to index all content elements with its own list of
authorized users IDs.

I was thinking more of something like I index the contents and the users +
their friend list separatly, and then being able somehow to ask Solr to
filter results of one index depending on the other. In SQL it would be
performed with a sub-query, for instance : 

SELECT a.* FROM albums a
  LEFT JOIN albums_settings as ON as.album_id = a.id
  WHERE as.privacy_level = 'anyone'
OR 
(as.privacy_level = 'friends'
   AND a.owner_id IN (
 SELECT friend_id FROM friendships
 WHERE user_id = :currentUserId
   )
)
;

It would require some tests, but this request should return only what we
want.

I was assuming by "complex query" that Solr would be able to perform that
kind of operation.

But if it does, that raises some questions :

- Is it the best way to do that ?
- It's obvious that i need to index the registered users in Solr (because an
user can search for others), but is it clever to index friend list for each
user as well ? (if we take a look at the search box on Facebook, or other
any sexy social network, they propose auto-complete for current user
friends, so maybe it makes sense...)


Br,
Benjamin.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Content-privacy-search-index-tp3873462p3874112.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Content privacy, search & index

2012-04-01 Thread dbenjamin
Hi Paul,

You lost me :-)

You mean implementing a specific RequestHandler just for my needs ?

Also, when you say "It'd transform a query for "a b" into "+(a b)
+(authorizedBit)"", that's not so clear to me, do you mind explaining this
like i was a 6 years old ? ;-) (even if I think that's just a matter of
syntax...)

Indeed, the friend list will obviously be cached.

Thanks.

Br,
Benjamin.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Content-privacy-search-index-tp3873462p3874961.html
Sent from the Solr - User mailing list archive at Nabble.com.


RE: Content privacy, search & index

2012-04-01 Thread dbenjamin
Hi spring,

Solution 1 is what i had in mind.

So i can't do the whole thing directly in Solr ? (Except maybe by
implementing a new RequestHandler like Paul suggested)

Concerning the auto-complete of friends in the search box, you won't use the
auto-complete feature from Solr then, will you ? Because the friend list
would not be indexed in Solr but retrieved from application cache. (well, if
you don't have answer to that it's ok because that's really secondary, the
privacy level being my primary concern.)

Concerning the size of the data, we have to consider they could grow
exponentially.
The hypothesis is : 300K users, an average of 100 friends each and 200
documents (each).


Br,
Benjamin.


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Content-privacy-search-index-tp3873462p3874982.html
Sent from the Solr - User mailing list archive at Nabble.com.


Strange behaviour with default request handler

2012-06-28 Thread dbenjamin
Hi,

I have a strange behaviour with the default request handler.

In the index i have :


2012-06-28T10:22:51Z

Sophie
user-6
Michel
Sophie
sophie


2012-06-28T10:22:51Z

Sophia
user-7
Martinez
Sophia
sophia


And when i search for "soph", i only get "Sophie" in the results and not
"Sophia".
When i search for "*:*", i get everything.

Why is that ? Did i miss a basic configuration option ?

My schema looks like :


   
   
   
   
   
   
   
   
 

id

who





Any advice ?
Thanks ! ;-)

Cya,
benjamin.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Strange-behaviour-with-default-request-handler-tp3991976.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Strange behaviour with default request handler

2012-07-10 Thread dbenjamin
Hey,

Sorry for the late answer.

Thanks for your help, i started with a wildcard after your advice, by
adding it automatically
when i build the request in my code.

But then, i found the n-gram filter, which is much appropriate for my use
case until i have
no performance issue ;-)

Thanks again.
Cya,

Benjamin.

2012/6/29 iorixxx [via Lucene] 

> > And when i search for "soph", i only get "Sophie" in the
> > results and not "Sophia".
>
> Do you want your query q=soph to return both Sophie and Sophia?
> If that's the case then you can use wildcard queries. q=soph*
>
> Also you didn't provide field definition type="text". It seems that you
> have stemming filter in your analysis chain.
>
> You can inspect how tokens Sophie and Sophia are indexed using
> solr/admin/analysis.jsp page.
>
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/Strange-behaviour-with-default-request-handler-tp3991976p3992063.html
>  To unsubscribe from Strange behaviour with default request handler, click
> here
> .
> NAML
>


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Strange-behaviour-with-default-request-handler-tp3991976p3994095.html
Sent from the Solr - User mailing list archive at Nabble.com.