Class ResponseBuilder
- java.lang.Object
-
- org.apache.solr.handler.component.ResponseBuilder
-
public class ResponseBuilder extends Object
This class is experimental and will be changing in the future.- Since:
- solr 1.3
-
-
Field Summary
Fields Modifier and Type Field Description FacetComponent.FacetInfo
_facetInfo
List<SearchComponent>
components
boolean
doAnalytics
boolean
doExpand
boolean
doFacets
boolean
doHighlights
boolean
doStats
boolean
doTerms
static String
FIELD_SORT_VALUES
List<ShardRequest>
finished
int
firstPhaseElapsedTime
static String
IDS
Map<String,Integer>
mergedGroupCounts
Map<String,QueryCommandResult>
mergedQueryCommandResults
Map<String,Collection<org.apache.lucene.search.grouping.SearchGroup<org.apache.lucene.util.BytesRef>>>
mergedSearchGroups
Map<String,org.apache.lucene.search.grouping.TopGroups<org.apache.lucene.util.BytesRef>>
mergedTopGroups
MergeStrategy
mergeFieldHandler
boolean
onePassDistributedQuery
List<ShardRequest>
outgoing
String
queryID
SolrQueryRequest
req
Map<Object,ShardDoc>
resultIds
Map<Object,org.apache.solr.common.SolrDocument>
retrievedDocuments
SolrQueryResponse
rsp
Map<String,Map<org.apache.lucene.search.grouping.SearchGroup<org.apache.lucene.util.BytesRef>,Set<String>>>
searchGroupToShards
String[]
shards
static String
SHARDS
int
shards_rows
int
shards_start
String
shortCircuitedURL
String[]
slices
int
stage
static int
STAGE_DONE
static int
STAGE_EXECUTE_QUERY
static int
STAGE_GET_FIELDS
static int
STAGE_PARSE_QUERY
static int
STAGE_START
public static final String NUMDOCS = "nd"; public static final String DOCFREQS = "tdf"; public static final String TERMS = "terms"; public static final String EXTRACT_QUERY_TERMS = "eqt"; public static final String LOCAL_SHARD = "local"; public static final String DOC_QUERY = "dq"; *static int
STAGE_TOP_GROUPS
int
totalHitCount
-
Constructor Summary
Constructors Constructor Description ResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, List<SearchComponent> components)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDebug(Object val, String... path)
void
addDebugInfo(String name, Object val)
Utility function to add debugging info.void
addMergeStrategy(MergeStrategy mergeStrategy)
void
addRequest(SearchComponent me, ShardRequest sreq)
QueryCommand
createQueryCommand()
Creates a SolrIndexSearcher.QueryCommand from this ResponseBuilder.Object
getAnalyticsRequestManager()
String
getCancellationUUID()
CursorMark
getCursorMark()
org.apache.solr.common.util.NamedList<Object>
getDebugInfo()
int
getFieldFlags()
List<org.apache.lucene.search.Query>
getFilters()
GroupingSpecification
getGroupingSpec()
org.apache.lucene.search.Query
getHighlightQuery()
List<MergeStrategy>
getMergeStrategies()
CursorMark
getNextCursorMark()
long
getNumberDocumentsFound()
QParser
getQparser()
org.apache.lucene.search.Query
getQuery()
String
getQueryString()
RankQuery
getRankQuery()
org.apache.solr.common.SolrDocumentList
getResponseDocs()
DocListAndSet
getResults()
int
getShardNum(String shard)
SortSpec
getSortSpec()
String
getTaskStatusCheckUUID()
RTimer
getTimer()
boolean
grouping()
boolean
isAnalytics()
boolean
isCancellation()
boolean
isDebug()
boolean
isDebugAll()
boolean
isDebugQuery()
boolean
isDebugResults()
boolean
isDebugTimings()
boolean
isDebugTrack()
boolean
isDistribStatsDisabled()
boolean
isDistributed()
This function will return true if this was a distributed search request.boolean
isNeedDocList()
boolean
isNeedDocSet()
boolean
isOlapAnalytics()
boolean
isTaskListRequest()
void
setAnalytics(boolean doAnalytics)
void
setAnalyticsRequestManager(Object analyticsRequestManager)
void
setCancellation(boolean isCancellation)
void
setCancellationUUID(String queryID)
void
setCursorMark(CursorMark cursorMark)
void
setDebug(boolean dbg)
void
setDebugInfo(org.apache.solr.common.util.NamedList<Object> debugInfo)
void
setDebugQuery(boolean debugQuery)
void
setDebugResults(boolean debugResults)
void
setDebugTimings(boolean debugTimings)
void
setDebugTrack(boolean debugTrack)
void
setDistribStatsDisabled(boolean isEnableDistribStats)
void
setFieldFlags(int fieldFlags)
void
setFilters(List<org.apache.lucene.search.Query> filters)
void
setGroupingSpec(GroupingSpecification groupingSpec)
void
setHighlightQuery(org.apache.lucene.search.Query highlightQuery)
void
setIsTaskListRequest(boolean isTaskListRequest)
void
setNeedDocList(boolean needDocList)
void
setNeedDocSet(boolean needDocSet)
void
setNextCursorMark(CursorMark nextCursorMark)
void
setOlapAnalytics(boolean isOlapAnalytics)
void
setQparser(QParser qparser)
void
setQuery(org.apache.lucene.search.Query query)
void
setQueryString(String qstr)
void
setRankQuery(RankQuery rankQuery)
void
setResponseDocs(org.apache.solr.common.SolrDocumentList _responseDocs)
void
setResult(QueryResult result)
Sets results from a SolrIndexSearcher.QueryResult.void
setResults(DocListAndSet results)
void
setSortSpec(SortSpec sortSpec)
void
setTaskStatusCheckUUID(String taskUUID)
void
setTimer(RTimer timer)
org.apache.lucene.search.Query
wrap(org.apache.lucene.search.Query q)
CallsRankQuery.wrap(Query)
if there's a rank query, otherwise just returns the query.
-
-
-
Field Detail
-
req
public SolrQueryRequest req
-
rsp
public SolrQueryResponse rsp
-
doHighlights
public boolean doHighlights
-
doFacets
public boolean doFacets
-
doExpand
public boolean doExpand
-
doStats
public boolean doStats
-
doTerms
public boolean doTerms
-
doAnalytics
public boolean doAnalytics
-
mergeFieldHandler
public MergeStrategy mergeFieldHandler
-
queryID
public String queryID
-
components
public List<SearchComponent> components
-
FIELD_SORT_VALUES
public static final String FIELD_SORT_VALUES
- See Also:
- Constant Field Values
-
SHARDS
public static final String SHARDS
- See Also:
- Constant Field Values
-
IDS
public static final String IDS
- See Also:
- Constant Field Values
-
STAGE_START
public static int STAGE_START
public static final String NUMDOCS = "nd"; public static final String DOCFREQS = "tdf"; public static final String TERMS = "terms"; public static final String EXTRACT_QUERY_TERMS = "eqt"; public static final String LOCAL_SHARD = "local"; public static final String DOC_QUERY = "dq"; *
-
STAGE_PARSE_QUERY
public static int STAGE_PARSE_QUERY
-
STAGE_TOP_GROUPS
public static int STAGE_TOP_GROUPS
-
STAGE_EXECUTE_QUERY
public static int STAGE_EXECUTE_QUERY
-
STAGE_GET_FIELDS
public static int STAGE_GET_FIELDS
-
STAGE_DONE
public static int STAGE_DONE
-
stage
public int stage
-
shards
public String[] shards
-
slices
public String[] slices
-
shards_rows
public int shards_rows
-
shards_start
public int shards_start
-
outgoing
public List<ShardRequest> outgoing
-
finished
public List<ShardRequest> finished
-
shortCircuitedURL
public String shortCircuitedURL
-
onePassDistributedQuery
public boolean onePassDistributedQuery
-
_facetInfo
public FacetComponent.FacetInfo _facetInfo
-
mergedSearchGroups
public final Map<String,Collection<org.apache.lucene.search.grouping.SearchGroup<org.apache.lucene.util.BytesRef>>> mergedSearchGroups
-
searchGroupToShards
public final Map<String,Map<org.apache.lucene.search.grouping.SearchGroup<org.apache.lucene.util.BytesRef>,Set<String>>> searchGroupToShards
-
mergedTopGroups
public final Map<String,org.apache.lucene.search.grouping.TopGroups<org.apache.lucene.util.BytesRef>> mergedTopGroups
-
mergedQueryCommandResults
public final Map<String,QueryCommandResult> mergedQueryCommandResults
-
totalHitCount
public int totalHitCount
-
firstPhaseElapsedTime
public int firstPhaseElapsedTime
-
-
Constructor Detail
-
ResponseBuilder
public ResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, List<SearchComponent> components)
-
-
Method Detail
-
isDistributed
public boolean isDistributed()
This function will return true if this was a distributed search request.
-
getShardNum
public int getShardNum(String shard)
-
addRequest
public void addRequest(SearchComponent me, ShardRequest sreq)
-
addDebugInfo
public void addDebugInfo(String name, Object val)
Utility function to add debugging info. This will make sure a valid debugInfo exists before adding to it.
-
isDebug
public boolean isDebug()
-
isDebugAll
public boolean isDebugAll()
- Returns:
- true if all debugging options are on
-
setDebug
public void setDebug(boolean dbg)
-
addMergeStrategy
public void addMergeStrategy(MergeStrategy mergeStrategy)
-
getMergeStrategies
public List<MergeStrategy> getMergeStrategies()
-
getRankQuery
public RankQuery getRankQuery()
-
setRankQuery
public void setRankQuery(RankQuery rankQuery)
-
setResponseDocs
public void setResponseDocs(org.apache.solr.common.SolrDocumentList _responseDocs)
-
getResponseDocs
public org.apache.solr.common.SolrDocumentList getResponseDocs()
-
isDebugTrack
public boolean isDebugTrack()
-
setDebugTrack
public void setDebugTrack(boolean debugTrack)
-
isDebugTimings
public boolean isDebugTimings()
-
setDebugTimings
public void setDebugTimings(boolean debugTimings)
-
isDebugQuery
public boolean isDebugQuery()
-
setDebugQuery
public void setDebugQuery(boolean debugQuery)
-
isDebugResults
public boolean isDebugResults()
-
setDebugResults
public void setDebugResults(boolean debugResults)
-
getDebugInfo
public org.apache.solr.common.util.NamedList<Object> getDebugInfo()
-
setDebugInfo
public void setDebugInfo(org.apache.solr.common.util.NamedList<Object> debugInfo)
-
getFieldFlags
public int getFieldFlags()
-
setFieldFlags
public void setFieldFlags(int fieldFlags)
-
getFilters
public List<org.apache.lucene.search.Query> getFilters()
-
setFilters
public void setFilters(List<org.apache.lucene.search.Query> filters)
-
getHighlightQuery
public org.apache.lucene.search.Query getHighlightQuery()
-
setHighlightQuery
public void setHighlightQuery(org.apache.lucene.search.Query highlightQuery)
-
isNeedDocList
public boolean isNeedDocList()
-
setNeedDocList
public void setNeedDocList(boolean needDocList)
-
isNeedDocSet
public boolean isNeedDocSet()
-
setNeedDocSet
public void setNeedDocSet(boolean needDocSet)
-
getQparser
public QParser getQparser()
-
setQparser
public void setQparser(QParser qparser)
-
getQueryString
public String getQueryString()
-
setQueryString
public void setQueryString(String qstr)
-
getQuery
public org.apache.lucene.search.Query getQuery()
-
setQuery
public void setQuery(org.apache.lucene.search.Query query)
-
getResults
public DocListAndSet getResults()
-
setResults
public void setResults(DocListAndSet results)
-
getSortSpec
public SortSpec getSortSpec()
-
setSortSpec
public void setSortSpec(SortSpec sortSpec)
-
getGroupingSpec
public GroupingSpecification getGroupingSpec()
-
setGroupingSpec
public void setGroupingSpec(GroupingSpecification groupingSpec)
-
grouping
public boolean grouping()
-
getTimer
public RTimer getTimer()
-
setTimer
public void setTimer(RTimer timer)
-
createQueryCommand
public QueryCommand createQueryCommand()
Creates a SolrIndexSearcher.QueryCommand from this ResponseBuilder. TimeAllowed is left unset.
-
wrap
public org.apache.lucene.search.Query wrap(org.apache.lucene.search.Query q)
CallsRankQuery.wrap(Query)
if there's a rank query, otherwise just returns the query.
-
setResult
public void setResult(QueryResult result)
Sets results from a SolrIndexSearcher.QueryResult.
-
getNumberDocumentsFound
public long getNumberDocumentsFound()
-
getCursorMark
public CursorMark getCursorMark()
-
setCursorMark
public void setCursorMark(CursorMark cursorMark)
-
getNextCursorMark
public CursorMark getNextCursorMark()
-
setNextCursorMark
public void setNextCursorMark(CursorMark nextCursorMark)
-
setAnalytics
public void setAnalytics(boolean doAnalytics)
-
isAnalytics
public boolean isAnalytics()
-
setAnalyticsRequestManager
public void setAnalyticsRequestManager(Object analyticsRequestManager)
-
getAnalyticsRequestManager
public Object getAnalyticsRequestManager()
-
setOlapAnalytics
public void setOlapAnalytics(boolean isOlapAnalytics)
-
isOlapAnalytics
public boolean isOlapAnalytics()
-
setCancellation
public void setCancellation(boolean isCancellation)
-
isCancellation
public boolean isCancellation()
-
setIsTaskListRequest
public void setIsTaskListRequest(boolean isTaskListRequest)
-
isTaskListRequest
public boolean isTaskListRequest()
-
setCancellationUUID
public void setCancellationUUID(String queryID)
-
getCancellationUUID
public String getCancellationUUID()
-
setTaskStatusCheckUUID
public void setTaskStatusCheckUUID(String taskUUID)
-
getTaskStatusCheckUUID
public String getTaskStatusCheckUUID()
-
setDistribStatsDisabled
public void setDistribStatsDisabled(boolean isEnableDistribStats)
-
isDistribStatsDisabled
public boolean isDistribStatsDisabled()
-
-