public class RestrictionImplementations
extends java.lang.Object
Legacy documentation below: Currently we are using Lucene 5.3.1 which allows
us to use the toParentBlockJoint mechanism to group related entity properties.
this was finessed to some extent by creating a boolean query over to parent block
join queries for each term insuring that parent docs returned contained both
terms when the restrictions are "anded"
***legacy docuementation of the bitset implementation*******
Class which implements all of the restriction operations using Lucene
searches.
Implementation details - The restrictions work by taking advantage of the
fact that lucene searches natively return bitsets - one bit for every
document in the index. True for yes, return this document, false for do not
return this document. When you do successive searches, you can and the bit
sets together to get the merged view of the queries.
Its not quite that simple in our case, however, since our indexes have one
document per presentation. So each concept code will have multiple lucene
"documents" - and since each document gets its own bit in the bitset - if we
match a presentation in search one for Concept A, and then match a different
presentation in search 2 for Concept A, and join the bit sets, it won't
return any trues for Concept A.
So, after each search, for any concept code which has a bit set to true, we
need to set all bits for that concept code to true.
Now, I take advantage of the fact that the documents are added to Lucene in
order, and all concept codes are grouped together. The codeBoundyFilter is a
special bitset which has a bit set to true for each boundry between concepts.
So we can use the codeBoundry filter to rapidly set all of the bits for a
concept to true.
- Version:
- subversion $Revision: $ checked in on $Date: $
- Author:
- Dan Armbrust, Jesse Erdmann, Deepak Sharma, Sridhar Dwarkanath, Kevin Peterson