public class SolrReturnFields extends ReturnFields
Modifier and Type | Class and Description |
---|---|
static class |
SolrReturnFields.FIELD_SOURCES |
Modifier and Type | Field and Description |
---|---|
protected boolean |
_wantsAllFields |
protected boolean |
_wantsScore |
protected Map<String,String> |
renameFields |
static String |
SCORE |
protected DocTransformer |
transformer |
Constructor and Description |
---|
SolrReturnFields() |
SolrReturnFields(SolrQueryRequest req) |
SolrReturnFields(String[] fl,
SolrQueryRequest req) |
SolrReturnFields(String fl,
SolrQueryRequest req) |
Modifier and Type | Method and Description |
---|---|
org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer |
getFetchOptimizer(Supplier<org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer> supplier) |
static String |
getFieldName(StrParser sp) |
Map<String,String> |
getFieldRenames()
Get the fields which have been renamed
|
SolrReturnFields.FIELD_SOURCES |
getFieldSources() |
Set<String> |
getLuceneFieldNames()
Set of field names with their exact names from the lucene index.
|
Set<String> |
getLuceneFieldNames(boolean ignoreWantsAll)
Set of field names with their exact names from the lucene index.
|
Set<String> |
getRequestedFieldNames()
The requested field names (includes pseudo fields)
|
DocTransformer |
getTransformer()
Returns the DocTransformer used to modify documents, or
null |
boolean |
hasPatternMatching()
Returns
true if the fieldnames should be picked with a pattern |
void |
setFieldSources(SolrReturnFields.FIELD_SOURCES fieldSources) |
String |
toString() |
boolean |
wantsAllFields()
Returns
true if all fields should be returned to the external client. |
boolean |
wantsField(String name)
Returns
true if the specified field should be returned to the external client
-- either using it's own name, or via an alias. |
boolean |
wantsScore()
Returns
true if the score should be returned. |
public static final String SCORE
protected DocTransformer transformer
protected boolean _wantsScore
protected boolean _wantsAllFields
public SolrReturnFields()
public SolrReturnFields(SolrQueryRequest req)
public SolrReturnFields(String fl, SolrQueryRequest req)
public SolrReturnFields(String[] fl, SolrQueryRequest req)
public SolrReturnFields.FIELD_SOURCES getFieldSources()
public void setFieldSources(SolrReturnFields.FIELD_SOURCES fieldSources)
public org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer getFetchOptimizer(Supplier<org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer> supplier)
public Map<String,String> getFieldRenames()
ReturnFields
getFieldRenames
in class ReturnFields
public Set<String> getLuceneFieldNames()
ReturnFields
SolrIndexSearcher.doc(int, Set)
.
NOTE: In some situations, this method may return null
even if ReturnFields.wantsAllFields()
is false
. For example: When glob expressions are used (ReturnFields.hasPatternMatching()
),
it is safer to request all field names then to attempt to resolve the globs against all possible
dynamic field names in the index.
getLuceneFieldNames
in class ReturnFields
null
(all fields).public Set<String> getLuceneFieldNames(boolean ignoreWantsAll)
ReturnFields
getLuceneFieldNames
in class ReturnFields
ignoreWantsAll
- If true, it returns any additional specified field names, in spite of
also wanting all fields. Example: when fl=*,field1, returns ["field1"].
If false, the method returns null when all fields are wanted. Example: when fl=*,field1, returns null.
Note that this method returns null regardless of ignoreWantsAll if all fields
are requested and no explicit field names are specified.public Set<String> getRequestedFieldNames()
ReturnFields
getRequestedFieldNames
in class ReturnFields
null
(all fields).public boolean hasPatternMatching()
ReturnFields
true
if the fieldnames should be picked with a patternhasPatternMatching
in class ReturnFields
public boolean wantsField(String name)
ReturnFields
true
if the specified field should be returned to the external client
-- either using it's own name, or via an alias.
This method returns false
even if the specified name is needed as an "extra" field
for use by transformers.wantsField
in class ReturnFields
public boolean wantsAllFields()
ReturnFields
true
if all fields should be returned to the external client.wantsAllFields
in class ReturnFields
public boolean wantsScore()
ReturnFields
true
if the score should be returned.wantsScore
in class ReturnFields
public DocTransformer getTransformer()
ReturnFields
null
getTransformer
in class ReturnFields
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.