Skip to content

Apache Lucene open-source search software

SOLR-20: Adding a document list class in 'common'

Ryan McKinley8f8b006c1c55
diff --git a/src/java/org/apache/solr/common/SolrDocumentList.java b/src/java/org/apache/solr/common/SolrDocumentList.java
new file mode 100644
index 00000000000..e996a19c5d5
--- /dev/null
+++ b/src/java/org/apache/solr/common/SolrDocumentList.java
@@ -0,0 +1,60 @@
+/**
+ * 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.common;
+
+import java.util.ArrayList;
+
+
+/**
+ * Represent a list of SolrDocuments returned from a search. This includes
+ * position and offset information.
+ *
+ * @author ryan
+ * @version $Id$
+ * @since solr 1.3
+ */
+public class SolrDocumentList extends ArrayList<SolrDocument>
+{
+ private int numFound = 0;
+ private int start = 0;
+ private Float maxScore = null;
+
+ public Float getMaxScore() {
+ return maxScore;
+ }
+
+ public void setMaxScore(Float maxScore) {
+ this.maxScore = maxScore;
+ }
+
+ public int getNumFound() {
+ return numFound;
+ }
+
+ public void setNumFound(int numFound) {
+ this.numFound = numFound;
+ }
+
+ public int getStart() {
+ return start;
+ }
+
+ public void setStart(int start) {
+ this.start = start;
+ }
+}