org.LexGrid.LexBIG.Impl.dataAccess
Class RestrictionImplementations
java.lang.Object
org.LexGrid.LexBIG.Impl.dataAccess.RestrictionImplementations
public class RestrictionImplementations
- extends java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RestrictionImplementations
public RestrictionImplementations()
getLogger
protected static LgLoggerIF getLogger()
getQuery
public static org.apache.lucene.search.Query getQuery(Restriction restriction,
java.lang.String internalCodeSystemName,
java.lang.String internalVersionString)
throws UnexpectedInternalError,
MissingResourceException,
LBParameterException
- Throws:
UnexpectedInternalError
MissingResourceException
LBParameterException
mapPropertyType
protected static java.lang.String mapPropertyType(CodedNodeSet.PropertyType propertyType)
throws LBInvocationException
- Throws:
LBInvocationException