STRING
}
public Query createQuery() {
Query query;
final SearchFactoryImplementor searchFactory = queryContext.getFactory();
final DocumentBuilderIndexedEntity documentBuilder = Helper.getDocumentBuilder( queryContext );
IndexReader indexReader = searchFactory.getIndexReaderAccessor().open( queryContext.getEntityType() );
// retrieving the docId and building the more like this query form the term vectors must be using the same index reader
try {
String[] fieldNames = getAllCompatibleFieldNames( documentBuilder );
if ( fieldsContext.size() == 0 ) {
// Use all compatible fields when comparingAllFields is used
fieldsContext.addAll( fieldNames );
}
query = new MoreLikeThisBuilder( documentBuilder, searchFactory )
.compatibleFieldNames( fieldNames )
.fieldsContext( fieldsContext )
.queryContext( queryContext )
.indexReader( indexReader )
.inputType( inputType )
.input( input )
.otherMoreLikeThisContext( moreLikeThisContext )
.createQuery();
}
finally {
searchFactory.getIndexReaderAccessor().close( indexReader );
}
//TODO implement INPUT.READER
//TODO implement INOUT.STRING
return queryCustomizer.setWrappedQuery( query ).createQuery();
}