Package org.apache.solr.search
Class SolrReturnFields
java.lang.Object
org.apache.solr.search.ReturnFields
org.apache.solr.search.SolrReturnFields
The default implementation of return fields parsing for Solr.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanstatic final Stringstatic final Stringstatic final Stringprotected DocTransformer -
Constructor Summary
ConstructorsConstructorDescriptionSolrReturnFields(String[] fl, SolrQueryRequest req) SolrReturnFields(String fl, SolrQueryRequest req) SolrReturnFields(Collection<String> plainFields, DocTransformer docTransformer) For pre-parsed simple field list with optional transformer. -
Method Summary
Modifier and TypeMethodDescriptionThe explicitly requested field names (includes pseudo fields)org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizergetFetchOptimizer(Supplier<org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer> supplier) static StringGet the fields which have been renamedSet of field names with their exact names from the lucene index.getLuceneFieldNames(boolean ignoreWantsAll) Set of field names with their exact names from the lucene index.The requested field names (includes pseudo fields)A mapping of return fields that depend on score and the names they are associated with.Returns the DocTransformer used to modify documents, ornullbooleanReturnstrueif the fieldnames should be picked with a patternvoidsetFieldSources(SolrReturnFields.FIELD_SOURCES fieldSources) toString()booleanReturnstrueif all fields should be returned to the external client.booleanwantsField(String name) Returnstrueif the specified field should be returned to the external client -- either using its own name, or via an alias.booleanReturnstrueif the score should be returned.Methods inherited from class org.apache.solr.search.ReturnFields
getNonScoreDependentReturnFieldNames
-
Field Details
-
SCORE
- See Also:
-
ORIGINAL_SCORE_NAME
- See Also:
-
ORIGINAL_SCORE
- See Also:
-
transformer
-
_wantsScore
protected boolean _wantsScore -
_wantsAllFields
protected boolean _wantsAllFields -
renameFields
-
-
Constructor Details
-
SolrReturnFields
public SolrReturnFields() -
SolrReturnFields
-
SolrReturnFields
-
SolrReturnFields
-
SolrReturnFields
For pre-parsed simple field list with optional transformer. Does not support globs or the score. This constructor is more for internal use; not for parsing user input.- Parameters:
plainFields- simple field list; nothing special. If null, equivalent to all-fields.docTransformer- optional transformer.
-
-
Method Details
-
getFieldSources
-
setFieldSources
-
getFetchOptimizer
public org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer getFetchOptimizer(Supplier<org.apache.solr.search.SolrDocumentFetcher.RetrieveFieldsOptimizer> supplier) -
getFieldRenames
Description copied from class:ReturnFieldsGet the fields which have been renamed- Specified by:
getFieldRenamesin classReturnFields- Returns:
- a mapping of renamed fields
-
getFieldName
-
getLuceneFieldNames
Description copied from class:ReturnFieldsSet of field names with their exact names from the lucene index. Class such as ResponseWriters pass this toSolrDocumentFetcher.doc(int, Set).NOTE: In some situations, this method may return
nulleven ifReturnFields.wantsAllFields()isfalse. 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.- Specified by:
getLuceneFieldNamesin classReturnFields- Returns:
- Set of field names or
null(all fields).
-
getLuceneFieldNames
Description copied from class:ReturnFieldsSet of field names with their exact names from the lucene index.- Specified by:
getLuceneFieldNamesin classReturnFields- 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
Description copied from class:ReturnFieldsThe requested field names (includes pseudo fields)- Specified by:
getRequestedFieldNamesin classReturnFields- Returns:
- Set of field names or
null(all fields).
-
getExplicitlyRequestedFieldNames
Description copied from class:ReturnFieldsThe explicitly requested field names (includes pseudo fields)- Specified by:
getExplicitlyRequestedFieldNamesin classReturnFields- Returns:
- Set of explicitly requested field names or
null(no explict)
-
hasPatternMatching
public boolean hasPatternMatching()Description copied from class:ReturnFieldsReturnstrueif the fieldnames should be picked with a pattern- Specified by:
hasPatternMatchingin classReturnFields
-
wantsField
Description copied from class:ReturnFieldsReturnstrueif the specified field should be returned to the external client -- either using its own name, or via an alias. This method returnsfalseeven if the specified name is needed as an "extra" field for use by transformers.- Specified by:
wantsFieldin classReturnFields
-
wantsAllFields
public boolean wantsAllFields()Description copied from class:ReturnFieldsReturnstrueif all fields should be returned to the external client.- Specified by:
wantsAllFieldsin classReturnFields
-
wantsScore
public boolean wantsScore()Description copied from class:ReturnFieldsReturnstrueif the score should be returned.- Specified by:
wantsScorein classReturnFields
-
getScoreDependentReturnFields
Description copied from class:ReturnFieldsA mapping of return fields that depend on score and the names they are associated with.- Specified by:
getScoreDependentReturnFieldsin classReturnFields- Returns:
- a mapping from return field name to the string representation of its definition
-
getTransformer
Description copied from class:ReturnFieldsReturns the DocTransformer used to modify documents, ornull- Specified by:
getTransformerin classReturnFields
-
toString
-