public class SolrDocumentFetcher extends Object
SolrIndexSearcher
for stored Document related matters
including DocValue substitutions.Modifier and Type | Method and Description |
---|---|
void |
decorateDocValueFields(SolrDocumentBase doc,
int docid,
Set<String> fields)
This will fetch and add the docValues fields to a given SolrDocument/SolrInputDocument
|
Document |
doc(int docId) |
Document |
doc(int i,
Set<String> fields)
Retrieve the
Document instance corresponding to the document id. |
void |
doc(int docId,
StoredFieldVisitor visitor) |
Set<String> |
getAllStored() |
SolrCache<Integer,Document> |
getDocumentCache() |
Set<String> |
getDvsCanSubstituteStored() |
Set<String> |
getNonStoredDVs(boolean onlyUseDocValuesAsStored)
Returns an unmodifiable set of non-stored docValues field names.
|
Set<String> |
getNonStoredDVsWithoutCopyTargets()
Returns an unmodifiable set of names of non-stored docValues fields, except those that are targets of a copy field.
|
Collection<String> |
getStoredHighlightFieldNames()
Returns a collection of the names of all stored fields which can be highlighted the index reader knows about.
|
boolean |
isLazyFieldLoadingEnabled() |
SolrDocument |
solrDoc(int luceneDocId,
SolrReturnFields solrReturnFields)
This is an optimized version for populating a SolrDocument that:
1.
|
public boolean isLazyFieldLoadingEnabled()
public Collection<String> getStoredHighlightFieldNames()
public Document doc(int docId) throws IOException
IOException
SolrIndexSearcher.doc(int)
public Document doc(int i, Set<String> fields) throws IOException
Document
instance corresponding to the document id.
NOTE: the document will have all fields accessible, but if a field filter is provided, only the provided fields will be loaded (the remainder will be available lazily).
IOException
SolrIndexSearcher.doc(int, Set)
public SolrDocument solrDoc(int luceneDocId, SolrReturnFields solrReturnFields)
luceneDocId
- The Lucene doc IDsolrReturnFields
- the structure holding the fields to be returned.
The first time this method is called for a particular
document list, it will be modified by adding a
RetrieveFieldsOptimizer for use in future calls.This method is designed to be as simple as possible to use, just call it. e.g. {code SolrDocument sdoc = docFetcher.solrDoc(id, solrReturnFields);} then process the resulting SolrDocument as usual. Subsequent calls with the same solrReturnFields will re-use the optimizer created the first time. NOTE: DO NOT re-use the same SolrReturnFields object if the fields requested change.
public void doc(int docId, StoredFieldVisitor visitor) throws IOException
IOException
SolrIndexSearcher.doc(int, StoredFieldVisitor)
public void decorateDocValueFields(SolrDocumentBase doc, int docid, Set<String> fields) throws IOException
doc
- A SolrDocument or SolrInputDocument instance where docValues will be addeddocid
- The lucene docid of the document to be populatedfields
- The fields with docValues to populate the document with.
DocValues fields which do not exist or not decodable will be ignored.IOException
public Set<String> getNonStoredDVs(boolean onlyUseDocValuesAsStored)
onlyUseDocValuesAsStored
- If false, returns all non-stored docValues. If true, returns only those non-stored docValues which have
the SchemaField.useDocValuesAsStored()
flag true.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.