private List < Bucket > lookup ( Record record ) { List < Bucket > buckets = new ArrayList ( ) ; for ( Property p : config . getLookupProperties ( ) ) { String propname = p . getName ( ) ; Collection < String > values = record . getValues ( propname ) ; if ( values == null ) continue ; for ( String value : values ) { String [ ] tokens = StringUtils . split ( value ) ; for ( int ix = 0 ; ix < tokens . length ; ix ++ ) { Bucket b = store . lookupToken ( propname , tokens [ ix ] ) ; if ( b == null || b . records == null ) continue ; long [ ] ids = b . records ; if ( DEBUG ) System . out . println ( propname + ", " + tokens [ ix ] + ": " + b . nextfree + " (" + b . getScore ( ) + ")" ) ; buckets . add ( b ) ; } } } return buckets ; }
Tokenizes lookup fields and returns all matching buckets in the index .