Package org.apache.solr.search
Class ReturnFields
- java.lang.Object
-
- org.apache.solr.search.ReturnFields
-
- Direct Known Subclasses:
SolrReturnFields
public abstract class ReturnFields extends Object
A class representing the return fields- Since:
- solr 4.0
-
-
Constructor Summary
Constructors Constructor Description ReturnFields()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Set<String>
getExplicitlyRequestedFieldNames()
The explicitly requested field names (includes pseudo fields)abstract Map<String,String>
getFieldRenames()
Get the fields which have been renamedabstract Set<String>
getLuceneFieldNames()
Set of field names with their exact names from the lucene index.abstract Set<String>
getLuceneFieldNames(boolean ignoreWantsAll)
Set of field names with their exact names from the lucene index.abstract Set<String>
getRequestedFieldNames()
The requested field names (includes pseudo fields)abstract DocTransformer
getTransformer()
Returns the DocTransformer used to modify documents, ornull
abstract boolean
hasPatternMatching()
Returnstrue
if the fieldnames should be picked with a patternabstract boolean
wantsAllFields()
Returnstrue
if all fields should be returned to the external client.abstract boolean
wantsField(String name)
Returnstrue
if the specified field should be returned to the external client -- either using its own name, or via an alias.abstract boolean
wantsScore()
Returnstrue
if the score should be returned.
-
-
-
Method Detail
-
getLuceneFieldNames
public abstract Set<String> getLuceneFieldNames()
Set of field names with their exact names from the lucene index. Class such as ResponseWriters pass this toSolrIndexSearcher.doc(int, Set)
.NOTE: In some situations, this method may return
null
even ifwantsAllFields()
isfalse
. For example: When glob expressions are used (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.- Returns:
- Set of field names or
null
(all fields).
-
getLuceneFieldNames
public abstract Set<String> getLuceneFieldNames(boolean ignoreWantsAll)
Set of field names with their exact names from the lucene index.- Parameters:
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.
-
getRequestedFieldNames
public abstract Set<String> getRequestedFieldNames()
The requested field names (includes pseudo fields)- Returns:
- Set of field names or
null
(all fields).
-
getExplicitlyRequestedFieldNames
public abstract Set<String> getExplicitlyRequestedFieldNames()
The explicitly requested field names (includes pseudo fields)- Returns:
- Set of explicitly requested field names or
null
(no explict)
-
getFieldRenames
public abstract Map<String,String> getFieldRenames()
Get the fields which have been renamed- Returns:
- a mapping of renamed fields
-
wantsField
public abstract boolean wantsField(String name)
Returnstrue
if the specified field should be returned to the external client -- either using its own name, or via an alias. This method returnsfalse
even if the specified name is needed as an "extra" field for use by transformers.
-
wantsAllFields
public abstract boolean wantsAllFields()
Returnstrue
if all fields should be returned to the external client.
-
wantsScore
public abstract boolean wantsScore()
Returnstrue
if the score should be returned.
-
hasPatternMatching
public abstract boolean hasPatternMatching()
Returnstrue
if the fieldnames should be picked with a pattern
-
getTransformer
public abstract DocTransformer getTransformer()
Returns the DocTransformer used to modify documents, ornull
-
-