You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2011/08/01 04:18:59 UTC

Re: An idea for an intersection type of filter query

: fq AND fq AND fq AND (fqu OR fqu OR fqu)
: 
: It would be awesome to have a syntax that creates arbitrarily complex and
: nested AND/OR combinations, but that would be a MAJOR undertaking.  The logic
: I've mentioned above seems to be the most useful you could get with just
: having the one additional parameter.  You can get pure union by just using

the syntax isn't really the hard part.  where things get tricky is in the 
internals of th SolrIndexSearcher and SearchHandler so that you cache 
those "fqu" params independently and then union the results, particularly 
when those fq/fqu params need to be part of the cache key for the 
queryResultCache ... a lot of little changes to the internals.

It's been discussed at a high level a sporadically over the years, but no 
one has had the drive/energy/knowledge to dig into the guts and make it 
work.

Having built several custom faceting components over the years (that apply 
special biz rules) i can tell you that generating DocSets and then 
computing unions/intersections is easy and efficient (the 
SolrIndexSearcher/SolrCache/DocSet APIs are really straight forward), but 
anytime you want to then use that DocSet to constrain a DocList ...  you 
run into complications.


-Hoss

Re: An idea for an intersection type of filter query

Posted by Shawn Heisey <so...@elyograg.org>.
On 7/31/2011 8:18 PM, Chris Hostetter wrote:
> the syntax isn't really the hard part.  where things get tricky is in the
> internals of th SolrIndexSearcher and SearchHandler so that you cache
> those "fqu" params independently and then union the results, particularly
> when those fq/fqu params need to be part of the cache key for the
> queryResultCache ... a lot of little changes to the internals.
>
> It's been discussed at a high level a sporadically over the years, but no
> one has had the drive/energy/knowledge to dig into the guts and make it
> work.
>
> Having built several custom faceting components over the years (that apply
> special biz rules) i can tell you that generating DocSets and then
> computing unions/intersections is easy and efficient (the
> SolrIndexSearcher/SolrCache/DocSet APIs are really straight forward), but
> anytime you want to then use that DocSet to constrain a DocList ...  you
> run into complications.

Thanks for the reply.  I never assumed implementation would be trivial.  
If it were, someone would have done it already.  Hopefully someone will 
be inspired to figure out the complications and work through them.

When I brought this up last week, I couldn't find a Jira issue 
describing it, so I was considering creating one.  Today I tried a 
different search and managed to locate SOLR-1223.  I've added a small 
note and voted for it.

Shawn