[ 
https://issues.apache.org/jira/browse/SOLR-12673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16587883#comment-16587883
 ] 

David Smiley commented on SOLR-12673:
-------------------------------------

The problem with "frange" is that it doesn't leverage the underlying index to 
scale.  It's O(docs) where "docs" is the number of docs in the index, or 
possible smaller if used with other filters.  In your example there were no 
other filters.

I rather like [~mkhludnev]'s solution of exclusive ranges; it is quite clever 
:).  My instinct is to use {{CoveringQuery}} as Mikhail also pointed out.  I 
suspect it may perform the best since unlike the exclusive range queries, it 
only has to "visit" the number of terms in your query, not all the other terms 
that might exist.  Although even Mikhail's idea could be improved to address 
that by using numbers instead of strings, and thus leverage the points index.  
Still, I recommend CoveringQuery.

> Superset Query
> --------------
>
>                 Key: SOLR-12673
>                 URL: https://issues.apache.org/jira/browse/SOLR-12673
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Varun Thacker
>            Priority: Major
>
> Here's the use-case I am trying to solve for document level access control.
> Documents :
> {code:java}
> [
>   {"id" : "1", "users" : ["user1"]},
>   {"id" : "2", "users" : ["user4"]},
>   {"id" : "3", "users" : ["user1", "user2"]},
>   {"id" : "4", "users" : ["user1", "user2", "user3"]},
>   {"id" : "5", "users" : ["user1", "user2", "user3", "user4"]}
> ]{code}
>  
> Query : If the document has any user apart from user1, user2 or user3 don't 
> show it.
> Results : id:1, id:3, id:4
> Query : If the document has any user apart from user1, user2 don't show it.
> Results : id:1, id:3
> I'm thinking this can be solved by writing a post-filter
> Syntax:
> {code:java}
> {!union_has_all field=users}user1,user2,user3{code}
> The post filter would get each document at a time and see if there is a user 
> in that document that is not part of the query.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to