//Enumerations using org.drools.workbench.screens.enums.backend.server.indexing.classes.Applicant
{
final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
true );
final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.enums.backend.server.indexing.classes.Applicant" ) ).build();
searcher.search( query,
collector );
final ScoreDoc[] hits = collector.topDocs().scoreDocs;
assertEquals( 2,
hits.length );
final List<KObject> results = new ArrayList<KObject>();
for ( int i = 0; i < hits.length; i++ ) {
results.add( KObjectUtil.toKObject( searcher.doc( hits[ i ].doc ) ) );
}
assertContains( results,
path1 );
assertContains( results,
path2 );
( (LuceneIndex) index ).nrtRelease( searcher );
}
//Enumerations using org.drools.workbench.screens.enums.backend.server.indexing.classes.Mortgage
{
final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
true );
final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.enums.backend.server.indexing.classes.Mortgage" ) ).build();
searcher.search( query,
collector );
final ScoreDoc[] hits = collector.topDocs().scoreDocs;
assertEquals( 1,
hits.length );
final List<KObject> results = new ArrayList<KObject>();
for ( int i = 0; i < hits.length; i++ ) {
results.add( KObjectUtil.toKObject( searcher.doc( hits[ i ].doc ) ) );
}
assertContains( results,
path2 );
( (LuceneIndex) index ).nrtRelease( searcher );
}
//Enumerations using org.drools.workbench.screens.enums.backend.server.indexing.classes.Mortgage#amount
{
final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
true );
final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "org.drools.workbench.screens.enums.backend.server.indexing.classes.Mortgage" ) ).addTerm( new ValueFieldIndexTerm( "amount" ) ).build();
searcher.search( query,
collector );
final ScoreDoc[] hits = collector.topDocs().scoreDocs;
assertEquals( 1,
hits.length );
final List<KObject> results = new ArrayList<KObject>();
for ( int i = 0; i < hits.length; i++ ) {
results.add( KObjectUtil.toKObject( searcher.doc( hits[ i ].doc ) ) );
}
assertContains( results,
path2 );
( (LuceneIndex) index ).nrtRelease( searcher );
}
//Enumerations using java.lang.Integer
{
final IndexSearcher searcher = ( (LuceneIndex) index ).nrtSearcher();
final TopScoreDocCollector collector = TopScoreDocCollector.create( 10,
true );
final Query query = new QueryBuilder().addTerm( new ValueTypeIndexTerm( "java.lang.Integer" ) ).build();
searcher.search( query,
collector );
final ScoreDoc[] hits = collector.topDocs().scoreDocs;
assertEquals( 2,