protected Set<String> getGroups( String field, String filedValue, String listField ) throws IOException, CorruptIndexException { final TopScoreDocCollector collector = TopScoreDocCollector.create( 1 ); final IndexSearcher indexSearcher = acquireIndexSearcher(); try { indexSearcher.search( new TermQuery( new Term( field, filedValue ) ), collector ); TopDocs topDocs = collector.topDocs(); Set<String> groups = new LinkedHashSet<String>( Math.max( 10, topDocs.totalHits ) ); if ( topDocs.totalHits > 0 ) { Document doc = indexSearcher.doc( topDocs.scoreDocs[0].doc ); String groupList = doc.get( listField ); if ( groupList != null ) { groups.addAll( Arrays.asList( groupList.split( "\\|" ) ) ); } } return groups; } finally { releaseIndexSearcher( indexSearcher ); } }
protected Set<String> getGroups( String field, String filedValue, String listField ) throws IOException, CorruptIndexException { final TopScoreDocCollector collector = TopScoreDocCollector.create( 1, false ); final IndexSearcher indexSearcher = acquireIndexSearcher(); try { indexSearcher.search( new TermQuery( new Term( field, filedValue ) ), collector ); TopDocs topDocs = collector.topDocs(); Set<String> groups = new LinkedHashSet<String>( Math.max( 10, topDocs.totalHits ) ); if ( topDocs.totalHits > 0 ) { Document doc = indexSearcher.doc( topDocs.scoreDocs[0].doc ); String groupList = doc.get( listField ); if ( groupList != null ) { groups.addAll( Arrays.asList( groupList.split( "\\|" ) ) ); } } return groups; } finally { releaseIndexSearcher( indexSearcher ); } }
protected Set<String> getGroups( String field, String filedValue, String listField ) throws IOException, CorruptIndexException { final TopScoreDocCollector collector = TopScoreDocCollector.create( 1 ); final IndexSearcher indexSearcher = acquireIndexSearcher(); try { indexSearcher.search( new TermQuery( new Term( field, filedValue ) ), collector ); TopDocs topDocs = collector.topDocs(); Set<String> groups = new LinkedHashSet<String>( Math.max( 10, topDocs.totalHits ) ); if ( topDocs.totalHits > 0 ) { Document doc = indexSearcher.doc( topDocs.scoreDocs[0].doc ); String groupList = doc.get( listField ); if ( groupList != null ) { groups.addAll( Arrays.asList( groupList.split( "\\|" ) ) ); } } return groups; } finally { releaseIndexSearcher( indexSearcher ); } }
public int getSize() throws IOException { final IndexSearcher is = acquireIndexSearcher(); try { return is.getIndexReader().numDocs(); } finally { releaseIndexSearcher( is ); } }
public int getSize() throws IOException { final IndexSearcher is = acquireIndexSearcher(); try { return is.getIndexReader().numDocs(); } finally { releaseIndexSearcher( is ); } }
public int getSize() throws IOException { final IndexSearcher is = acquireIndexSearcher(); try { return is.getIndexReader().numDocs(); } finally { releaseIndexSearcher( is ); } }
public synchronized void rebuildGroups() throws IOException final IndexSearcher is = acquireIndexSearcher(); try
public synchronized void rebuildGroups() throws IOException final IndexSearcher is = acquireIndexSearcher(); try
public synchronized void rebuildGroups() throws IOException final IndexSearcher is = acquireIndexSearcher(); try
public synchronized void merge( Directory directory, DocumentFilter filter ) throws IOException final IndexSearcher s = acquireIndexSearcher(); try
public synchronized void merge( Directory directory, DocumentFilter filter ) throws IOException final IndexSearcher s = acquireIndexSearcher(); try
public synchronized void merge( Directory directory, DocumentFilter filter ) throws IOException final IndexSearcher s = acquireIndexSearcher(); try
final IndexSearcher indexSearcher = acquireIndexSearcher(); try
final IndexSearcher indexSearcher = acquireIndexSearcher(); try
final IndexSearcher indexSearcher = acquireIndexSearcher(); try