public void prepareEmbeddedId ( TopDocs docs , Map < String , Object > indexCol , IndexSearcher searcher , EntityMetadata metadata , MetamodelImpl metaModel ) { try { for ( ScoreDoc sc : docs . scoreDocs ) { Document doc = searcher . doc ( sc . doc ) ; Map < String , Object > embeddedIdFields = new HashMap < String , Object > ( ) ; EmbeddableType embeddableId = metaModel . embeddable ( metadata . getIdAttribute ( ) . getBindableJavaType ( ) ) ; Set < Attribute > embeddedAttributes = embeddableId . getAttributes ( ) ; prepareEmbeddedIdFields ( embeddedAttributes , metaModel , embeddedIdFields , doc , metadata ) ; String entityId = doc . get ( IndexingConstants . ENTITY_ID_FIELD ) ; indexCol . put ( entityId , embeddedIdFields ) ; } } catch ( Exception e ) { log . error ( "Error while parsing Lucene Query {} " , e ) ; throw new LuceneIndexingException ( e ) ; } }
search the data from lucene for embeddedid