private void closeSearcher(LazyQueryState searcherWithPayload) { if ( searcherWithPayload == null ) { return; } searcherWithPayload.close(); }
/** * This document loading strategy doesn't return anything as it's the responsibility * of the passed StoredFieldVisitor instance to collect the data it needs. * * @param index {@link ScoreDoc} index * @param fieldVisitor accessor to the stored field value in the index * * @throws IOException if an error occurs accessing the index */ public void visitDocument(int index, StoredFieldVisitor fieldVisitor) throws IOException { searcher.doc( docId( index ), fieldVisitor ); }
private TopDocsCollector<?> createTopDocCollector(int maxDocs) throws IOException { TopDocsCollector<?> topCollector; if ( sort == null ) { topCollector = TopScoreDocCollector.create( maxDocs ); } else { boolean fillFields = true; topCollector = TopFieldCollector.create( sort, maxDocs, fillFields, searcher.isFieldSortDoTrackScores(), searcher.isFieldSortDoMaxScore() ); } return topCollector; }
Collection<EntityIndexBinding> targetedEntityBindings = targetedEntityBindingsByName.values(); if ( Boolean.TRUE.equals( forceScoring ) ) { return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters,
public Explanation explain(int index) throws IOException { final Explanation explanation = searcher.explain( filters, docId( index ) ); timeoutManager.isTimedOut(); return explanation; }
putInFieldTypeBucket( stringEncodedFieldNames, numericEncodedFieldNames, fieldDescriptor ); putInFieldTypeBucket( stringEncodedFieldNames, numericEncodedFieldNames, fieldDescriptor );
SortedSetDocValuesReaderState docValuesReaderState; try { docValuesReaderState = new DefaultSortedSetDocValuesReaderState( searcher.getIndexReader() ); termValues = findAllTermsForField( facetMetadata.getSourceField().getAbsoluteName(), searcher.getIndexReader() );
.searchExecuted( searcher.describeQuery(), System.nanoTime() - startTime );
Collection<EntityIndexBinding> targetedEntityBindings = targetedEntityBindingsByName.values(); if ( Boolean.TRUE.equals( forceScoring ) ) { return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters, return new LazyQueryState( filteredQuery, facetingFilters,
public Explanation explain(int index) throws IOException { final Explanation explanation = searcher.explain( filters, docId( index ) ); timeoutManager.isTimedOut(); return explanation; }
putInFieldTypeBucket( stringEncodedFieldNames, numericEncodedFieldNames, fieldDescriptor ); putInFieldTypeBucket( stringEncodedFieldNames, numericEncodedFieldNames, fieldDescriptor );
private ArrayList<Facet> updateStringFacets(DiscreteFacetRequest facetRequest, FacetMetadata facetMetadata) throws IOException { SortedSetDocValuesReaderState docValuesReaderState; try { docValuesReaderState = new DefaultSortedSetDocValuesReaderState( searcher.getIndexReader() ); termValues = findAllTermsForField( facetMetadata.getSourceField().getAbsoluteName(), searcher.getIndexReader() );
.searchExecuted( searcher.describeQuery(), System.nanoTime() - startTime );
private TopDocsCollector<?> createTopDocCollector(int maxDocs) throws IOException { TopDocsCollector<?> topCollector; if ( sort == null ) { topCollector = TopScoreDocCollector.create( maxDocs ); } else { boolean fillFields = true; topCollector = TopFieldCollector.create( sort, maxDocs, fillFields, searcher.isFieldSortDoTrackScores(), searcher.isFieldSortDoMaxScore() ); } return topCollector; }
LazyQueryState lowLevelSearcher = new LazyQueryState( luceneQuery, QueryFilters.EMPTY_FILTERSET,
@Override public void close() { searcher.close(); }
/** * This document loading strategy doesn't return anything as it's the responsibility * of the passed StoredFieldVisitor instance to collect the data it needs. * * @param index {@link ScoreDoc} index * @param fieldVisitor accessor to the stored field value in the index * * @throws IOException if an error occurs accessing the index */ public void visitDocument(int index, StoredFieldVisitor fieldVisitor) throws IOException { searcher.doc( docId( index ), fieldVisitor ); }
@Override public Explanation explain(int documentId) { //don't use TimeoutManager here as explain is a dev tool when things are weird... or slow :) Explanation explanation = null; LazyQueryState searcher = buildSearcher( extendedIntegrator, true ); if ( searcher == null ) { throw new SearchException( "Unable to build explanation for document id:" + documentId + ". no index found" ); } try { QueryFilters filters = createFilters(); explanation = searcher.explain( filters, documentId ); } catch (IOException e) { throw new SearchException( "Unable to query Lucene index and build explanation", e ); } finally { closeSearcher( searcher ); } return explanation; }