org.apache.solr.response.SolrQueryResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solr-core Show documentation
Show all versions of solr-core Show documentation
Apache Solr (module: core)
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.response;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.http.HttpServletResponse;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.search.ReturnFields;
import org.apache.solr.search.SolrReturnFields;
/**
* SolrQueryResponse
is used by a query handler to return
* the response to a query request.
*
*
* Note On Returnable Data...
* A SolrQueryResponse
may contain the following types of
* Objects generated by the SolrRequestHandler
that processed
* the request.
*
*
* - {@link String}
* - {@link Integer}
* - {@link Long}
* - {@link Float}
* - {@link Double}
* - {@link Boolean}
* - {@link Date}
* - {@link org.apache.solr.search.DocList}
* - {@link org.apache.solr.common.SolrDocument} (since 1.3)
* - {@link org.apache.solr.common.SolrDocumentList} (since 1.3)
* - {@link Map} containing any of the items in this list
* - {@link NamedList} containing any of the items in this list
* - {@link Collection} containing any of the items in this list
* - Array containing any of the items in this list
* - null
*
*
* Other data types may be added to the SolrQueryResponse, but there is no guarantee
* that QueryResponseWriters will be able to deal with unexpected types.
*
*
*
* @since solr 0.9
*/
public class SolrQueryResponse {
public static final String NAME = "response";
public static final String RESPONSE_HEADER_PARTIAL_RESULTS_KEY = "partialResults";
public static final String RESPONSE_HEADER_SEGMENT_TERMINATED_EARLY_KEY = "segmentTerminatedEarly";
private static final String RESPONSE_HEADER_KEY = "responseHeader";
private static final String RESPONSE_KEY = "response";
/**
* Container for user defined values
* @see #getValues
* @see #add
* @see #setAllValues
* @see Note on Returnable Data
*/
protected NamedList