@ Override public OIndexFullText put ( final Object iKey , final OIdentifiable iSingleValue ) { if ( iKey == null ) return this ; modificationLock . requestModificationLock ( ) ; try { final List < String > words = splitIntoWords ( iKey . toString ( ) ) ; // FOREACH WORD CREATE THE LINK TO THE CURRENT DOCUMENT for ( final String word : words ) { acquireExclusiveLock ( ) ; try { Set < OIdentifiable > refs ; // SEARCH FOR THE WORD refs = map . get ( word ) ; if ( refs == null ) // WORD NOT EXISTS: CREATE THE KEYWORD CONTAINER THE FIRST TIME THE WORD IS FOUND refs = new OMVRBTreeRIDSet ( ) . setAutoConvert ( false ) ; // ADD THE CURRENT DOCUMENT AS REF FOR THAT WORD refs . add ( iSingleValue ) ; // SAVE THE INDEX ENTRY map . put ( word , refs ) ; } finally { releaseExclusiveLock ( ) ; } } return this ; } finally { modificationLock . releaseModificationLock ( ) ; } }
Indexes a value and save the index . Splits the value in single words and index each one . Save of the index is responsibility of the caller .