Benjamin, I think implementing a QueryHandler that adds the necessary query is the right way to do that. It'd transform a query for "a b" into "+(a b) +(authorizedBit)" (to use the language of the default QueryParser but please not by substring, using the real query objects!).
Recalculating the friends-list... well... that all depends on your authorization system, this should be cached somewhere in a session or so, ideally you'd even cache somewhere close to there the queries that you add. Then performance is likely to be ok. paul Le 31 mars 2012 à 15:57, dbenjamin a écrit : > 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.