public List < MtasTreeHit < String > > getPositionedTermsByPrefixesAndPositionRange ( String field , int docId , List < String > prefixes , int startPosition , int endPosition ) throws IOException { IndexDoc doc = getDoc ( field , docId ) ; IndexInput inIndexObjectPosition = indexInputList . get ( "indexObjectPosition" ) ; if ( doc != null ) { ArrayList < MtasTreeHit < ? > > hitItems = CodecSearchTree . searchMtasTree ( startPosition , endPosition , inIndexObjectPosition , doc . fpIndexObjectPosition , doc . smallestObjectFilepointer ) ; List < MtasTreeHit < String > > hits = new ArrayList <> ( ) ; Map < String , Integer > prefixIds = getPrefixesIds ( field , prefixes ) ; if ( prefixIds != null && prefixIds . size ( ) > 0 ) { ArrayList < MtasTreeHit < ? > > filteredHitItems = new ArrayList < MtasTreeHit < ? > > ( ) ; for ( MtasTreeHit < ? > hitItem : hitItems ) { if ( prefixIds . containsValue ( hitItem . additionalId ) ) { filteredHitItems . add ( hitItem ) ; } } if ( filteredHitItems . size ( ) > 0 ) { ArrayList < MtasTokenString > objects = getObjects ( filteredHitItems ) ; for ( MtasTokenString token : objects ) { MtasTreeHit < String > hit = new MtasTreeHit < String > ( token . getPositionStart ( ) , token . getPositionEnd ( ) , token . getTokenRef ( ) , 0 , 0 , token . getValue ( ) ) ; hits . add ( hit ) ; } } } return hits ; } else { return new ArrayList < MtasTreeHit < String > > ( ) ; } }
Gets the positioned terms by prefixes and position range .