You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Brian Pearson (JIRA)" <ji...@apache.org> on 2009/06/16 20:35:07 UTC
[jira] Created: (SOLR-1223) Query Filter fq with OR operator
Query Filter fq with OR operator
--------------------------------
Key: SOLR-1223
URL: https://issues.apache.org/jira/browse/SOLR-1223
Project: Solr
Issue Type: New Feature
Components: search
Reporter: Brian Pearson
Priority: Minor
See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1223) Query Filter fq with OR operator
Posted by "Brian Pearson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736855#action_12736855 ]
Brian Pearson commented on SOLR-1223:
-------------------------------------
Hey folks,
As I've mentioned above, this issue is very important to me, or rather to my employer. If there was a way to accelerate the development, we'd be interested to talk about it. Perhaps a substantial donation, or some other deal could be worked out. Of course, the feature would need to be implemented properly with the intention of integrating it into the main codeline. I think it would be a valuable addition to Solr especially for anyone doing complex authorization, not to mention the other uses and performance benefits this would have.
Thanks all
> Query Filter fq with OR operator
> --------------------------------
>
> Key: SOLR-1223
> URL: https://issues.apache.org/jira/browse/SOLR-1223
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Brian Pearson
> Priority: Minor
>
> See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
> This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
> The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1223) Query Filter fq with OR operator
Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724781#action_12724781 ]
Lance Norskog commented on SOLR-1223:
-------------------------------------
The problem with BP's suggestion is that (fq1 & fq2) OR (fq3 & fq4) is not possible. One ends up wanting to do everything with NAND. Or postfix notation.
To have a tree-structured AND/OR/NOT expression we need to name the individual filter queries and then reference them in a tree.
fq1=query
fq2=query
fq3=query
fq4=query
fq=(fq1 AND fq2) OR (fq3 & fq4)
This can be done without naming filters if we just have something that finds filter queries as subtrees in a given query. If "field:3" is a cached filter query, this tree-walker would find that cached filter in fq="+a +field:3". It would then do a search of "+a" applying the existing filter "field:3".
I vote for named filters as the most transparent system for dynamically compositing filters.
> Query Filter fq with OR operator
> --------------------------------
>
> Key: SOLR-1223
> URL: https://issues.apache.org/jira/browse/SOLR-1223
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Brian Pearson
> Priority: Minor
>
> See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
> This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
> The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1223) Query Filter fq with OR operator
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720349#action_12720349 ]
Yonik Seeley commented on SOLR-1223:
------------------------------------
The hardest part to this is passing the information through the Solr APIs to tell Solr to cache the clauses of a particular boolean query separately.
2 approaches:
- a SolrQuery that wrapps a normal Query and adds extra metadata like "cache separately" or "don't cache"
- replace Query with SolrFilter (that contains a Query as well as the extra metadata)... involves many deprecations.
> Query Filter fq with OR operator
> --------------------------------
>
> Key: SOLR-1223
> URL: https://issues.apache.org/jira/browse/SOLR-1223
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Brian Pearson
> Priority: Minor
>
> See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
> This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
> The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1223) Query Filter fq with OR operator
Posted by "Brian Pearson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720710#action_12720710 ]
Brian Pearson commented on SOLR-1223:
-------------------------------------
Just putting my thoughts out .. obviously don't have the same understanding as Yonik :)
Feels like specifying which filter's are cached doesn't need to be part of this issue. This issue could just be about specifying the boolean logic that gets applied to the Doc Maps that are created by the filters. So today you have a number of filters .. F1, F2, ... FN and the boolean logic is F1 & F2 & .. &FN
What I'm hoping for is something simple where you have 2 groups, the AND group and the OR group.
AND group: A1, A2
OR group: O1, O2
So the filter you end up with is (A1 & A2) & (O1 | O2). The caching logic doesn't need to change then, there are still 4 filter queries.
Real example:
Current method
fq=popularity:[10 TO *] OR section:0
fq=type:2
New method (assuming we added ofq for the OR'd filter query group, probably there is a better way to make the API )
ofq=popularity:[10 TO *]
ofq=section:0
fq=type:2
I realize I'm probably missing some important implementation details that Yonik alludes to, just wanted to get my thoughts down. I wish I was in a position to actually work on this .. if someone takes this on, I can help with beta testing and documentation.
If anyone cares, the reason I want this is because my apps have extremely complicated authorization logic. I can do what I need using fq's, but the filters get large and are very specific to the user that did the search. If I had OR logic, then I could break the filters down into smaller pieces, which would be much more reusable from the cache, and performance would be much better
Thanks for listening :)
> Query Filter fq with OR operator
> --------------------------------
>
> Key: SOLR-1223
> URL: https://issues.apache.org/jira/browse/SOLR-1223
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Brian Pearson
> Priority: Minor
>
> See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
> This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
> The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-1223) Query Filter fq with OR operator
Posted by "Brian Pearson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727526#action_12727526 ]
Brian Pearson commented on SOLR-1223:
-------------------------------------
Hey Lance, that solution would be perfect and certainly more powerful than what I suggested. Again, if anyone takes this up, I can help with testing and docs
> Query Filter fq with OR operator
> --------------------------------
>
> Key: SOLR-1223
> URL: https://issues.apache.org/jira/browse/SOLR-1223
> Project: Solr
> Issue Type: New Feature
> Components: search
> Reporter: Brian Pearson
> Priority: Minor
>
> See this [issue|http://www.nabble.com/Query-Filter-fq-with-OR-operator-td23895837.html] for some background. Today, all of the Query filters specified with the fq parameter are AND'd together.
> This issue is about allowing a set of filters to be OR'd together (in addition to having another set of filters that are AND'd). The OR'd filters would of course be applied before any scoring is done.
> The advantage of this feature is that you will be able to break up complex filters into simple, more cacheable filters, which should improve performance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.