You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by su...@apache.org on 2012/04/13 17:16:17 UTC

svn commit: r1325800 - in /incubator/stanbol/branches/faceted-browsing/contenthub: search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/ servicesapi/src/ma...

Author: suat
Date: Fri Apr 13 15:16:16 2012
New Revision: 1325800

URL: http://svn.apache.org/viewvc?rev=1325800&view=rev
Log:
STANBOL-584: 
-Completed default implementation of ConstrainedDocumentList, however there are still some points while querying the solr e.g adjusting number of documents to be obtained, etc

Added:
    incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/DefaultConstrainedDocumentList.java
    incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentList.java
      - copied, changed from r1325635, incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentSet.java
Removed:
    incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstrainedDocumentSetImpl.java
    incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentSet.java
Modified:
    incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstraintImpl.java
    incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FacetImpl.java
    incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FeaturedSearchImpl.java
    incubator/stanbol/branches/faceted-browsing/contenthub/search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/SolrQueryUtil.java
    incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/Facet.java
    incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/FeaturedSearch.java

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstraintImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstraintImpl.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstraintImpl.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/ConstraintImpl.java Fri Apr 13 15:16:16 2012
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed 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.stanbol.contenthub.search.featured;
 
 import org.apache.stanbol.contenthub.servicesapi.search.featured.Constraint;
@@ -17,6 +32,7 @@ public class ConstraintImpl implements C
         }
         this.value = value;
         this.facet = facet;
+        facet.getConstraints().add(this);
     }
 
     @Override

Added: incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/DefaultConstrainedDocumentList.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/DefaultConstrainedDocumentList.java?rev=1325800&view=auto
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/DefaultConstrainedDocumentList.java (added)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/DefaultConstrainedDocumentList.java Fri Apr 13 15:16:16 2012
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed 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.stanbol.contenthub.search.featured;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.clerezza.rdf.core.PlainLiteral;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
+import org.apache.solr.client.solrj.response.FacetField;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.stanbol.contenthub.servicesapi.search.SearchException;
+import org.apache.stanbol.contenthub.servicesapi.search.featured.ConstrainedDocumentList;
+import org.apache.stanbol.contenthub.servicesapi.search.featured.Constraint;
+import org.apache.stanbol.contenthub.servicesapi.search.featured.Facet;
+import org.apache.stanbol.contenthub.servicesapi.search.featured.FeaturedSearch;
+import org.apache.stanbol.contenthub.servicesapi.store.vocabulary.SolrVocabulary.SolrFieldName;
+
+public class DefaultConstrainedDocumentList implements ConstrainedDocumentList {
+
+    private String queryTerm;
+    private FeaturedSearch featuredSearch;
+    private List<UriRef> documentURIs;
+    private Set<Constraint> constraints;
+    private Set<Facet> facets;
+
+    public DefaultConstrainedDocumentList(String queryTerm,
+                                          QueryResponse queryResponse,
+                                          Set<Constraint> constraints,
+                                          FeaturedSearch featuredSearch) throws SearchException {
+        this.queryTerm = queryTerm;
+        this.featuredSearch = featuredSearch;
+        parseQueryResponse(queryResponse);
+        this.constraints = constraints;
+    }
+
+    @Override
+    public List<UriRef> getDocuments() throws SearchException {
+        return documentURIs;
+    }
+
+    private void parseQueryResponse(QueryResponse queryResponse) {
+        // parse ids
+        List<UriRef> ids = new ArrayList<UriRef>();
+        SolrDocumentList documentList = queryResponse.getResults();
+        for (SolrDocument solrDocument : documentList) {
+            ids.add(new UriRef((String) solrDocument.getFieldValue(SolrFieldName.ID.toString())));
+        }
+        documentURIs = ids;
+
+        // parse facets
+        Set<Facet> facets = new HashSet<Facet>();
+        for (FacetField facetField : queryResponse.getFacetFields()) {
+            List<PlainLiteral> labels = new ArrayList<PlainLiteral>();
+            labels.add(new PlainLiteralImpl(facetField.getName()));
+            Facet facet = new FacetImpl(labels);
+            facets.add(facet);
+            List<Count> values = facetField.getValues();
+            if (values != null) {
+                for (Count count : facetField.getValues()) {
+                    new ConstraintImpl(count.getName(), facet);
+                }
+            }
+        }
+        this.facets = facets;
+    }
+
+    @Override
+    public Set<Constraint> getConstraints() {
+        return this.constraints != null ? this.constraints : new HashSet<Constraint>();
+    }
+
+    @Override
+    public Set<Facet> getFacets() {
+        return this.facets;
+    }
+
+    public ConstrainedDocumentList subSet(int offset, int limit) throws SearchException {
+        return featuredSearch.search(queryTerm, getConstraints(), offset, limit);
+    }
+
+    @Override
+    public ConstrainedDocumentList narrow(Constraint constraint) throws SearchException {
+        Set<Constraint> newConstraints = new HashSet<Constraint>(getConstraints());
+        newConstraints.add(constraint);
+        return featuredSearch.search(queryTerm, newConstraints);
+    }
+
+    @Override
+    public ConstrainedDocumentList broaden(Constraint constraint) throws SearchException {
+        Set<Constraint> newConstraints = new HashSet<Constraint>(getConstraints());
+        newConstraints.remove(constraint);
+        return featuredSearch.search(queryTerm, newConstraints);
+    }
+}

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FacetImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FacetImpl.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FacetImpl.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FacetImpl.java Fri Apr 13 15:16:16 2012
@@ -15,6 +15,7 @@
  */
 package org.apache.stanbol.contenthub.search.featured;
 
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
@@ -49,10 +50,7 @@ public class FacetImpl implements Facet 
             throw new IllegalArgumentException("Label list must include at least one item");
         }
         this.labels = labels;
-    }
-
-    public void setConstraints(Set<Constraint> constraints) {
-        this.constraints = constraints;
+        this.constraints = new HashSet<Constraint>();
     }
 
     @Override

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FeaturedSearchImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FeaturedSearchImpl.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FeaturedSearchImpl.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/search/featured/src/main/java/org/apache/stanbol/contenthub/search/featured/FeaturedSearchImpl.java Fri Apr 13 15:16:16 2012
@@ -47,7 +47,7 @@ import org.apache.stanbol.commons.solr.m
 import org.apache.stanbol.contenthub.search.featured.util.SolrContentItemConverter;
 import org.apache.stanbol.contenthub.search.solr.util.SolrQueryUtil;
 import org.apache.stanbol.contenthub.servicesapi.search.SearchException;
-import org.apache.stanbol.contenthub.servicesapi.search.featured.ConstrainedDocumentSet;
+import org.apache.stanbol.contenthub.servicesapi.search.featured.ConstrainedDocumentList;
 import org.apache.stanbol.contenthub.servicesapi.search.featured.Constraint;
 import org.apache.stanbol.contenthub.servicesapi.search.featured.DocumentResult;
 import org.apache.stanbol.contenthub.servicesapi.search.featured.FacetResult;
@@ -186,40 +186,40 @@ public class FeaturedSearchImpl implemen
         SolrQuery solrQuery = new SolrQuery();
         solrQuery.add(solrParams);
         List<FacetResult> allFacets = getAllFacetResults(ldProgramName);
-        SolrQueryUtil.setFacetParameters(solrQuery, allFacets);
+        SolrQueryUtil.setFacetFields(solrQuery, allFacets);
         QueryResponse queryResponse = solrSearch.search(solrQuery, ldProgramName);
         String queryTerm = SolrQueryUtil.extractQueryTermFromSolrQuery(solrParams);
         return search(queryTerm, queryResponse, ontologyURI, ldProgramName, allFacets);
     }
 
     @Override
-    public ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints) throws SearchException {
+    public ConstrainedDocumentList search(String keyword, Set<Constraint> constraints) throws SearchException {
         SolrQuery query = SolrQueryUtil.prepareSolrQuery(keyword);
+        SolrQueryUtil.addConstraintsToSolrQuery(constraints, query);
         List<FacetResult> allFacets = getAllFacetResults();
-        SolrQueryUtil.setFacetParameters(query, allFacets);
+        SolrQueryUtil.setFacetFields(query, allFacets);
         QueryResponse queryResponse = solrSearch.search(query);
-
-        return null;
+        return new DefaultConstrainedDocumentList(keyword, queryResponse, constraints, this);
     }
 
     @Override
-    public ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints, String indexName) throws SearchException {
+    public ConstrainedDocumentList search(String keyword, Set<Constraint> constraints, String indexName) throws SearchException {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints, int offset, int limit) throws SearchException {
+    public ConstrainedDocumentList search(String keyword, Set<Constraint> constraints, int offset, int limit) throws SearchException {
         // TODO Auto-generated method stub
         return null;
     }
 
     @Override
-    public ConstrainedDocumentSet search(String keyword,
-                                         Set<Constraint> constraints,
-                                         String indexName,
-                                         int offset,
-                                         int limit) throws SearchException {
+    public ConstrainedDocumentList search(String keyword,
+                                          Set<Constraint> constraints,
+                                          String indexName,
+                                          int offset,
+                                          int limit) throws SearchException {
         // TODO Auto-generated method stub
         return null;
     }

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/SolrQueryUtil.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/SolrQueryUtil.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/SolrQueryUtil.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/search/solr/src/main/java/org/apache/stanbol/contenthub/search/solr/util/SolrQueryUtil.java Fri Apr 13 15:16:16 2012
@@ -125,7 +125,7 @@ public class SolrQueryUtil {
      * @param allAvailableFacetNames
      *            list of facets
      */
-    public static <T> void setFacetParameters(SolrQuery solrQuery, List<T> allAvailableFacetNames) {
+    public static <T> void setFacetFields(SolrQuery solrQuery, List<T> allAvailableFacetNames) {
         solrQuery.setFields("*", SCORE_FIELD);
         solrQuery.setFacet(true);
         solrQuery.setFacetMinCount(1);
@@ -166,7 +166,7 @@ public class SolrQueryUtil {
                                                                                      IOException {
         SolrQuery solrQuery = new SolrQuery();
         solrQuery.setQuery(queryTerm);
-        setFacetParameters(solrQuery, getAllFacetNames(solrServer));
+        setFacetFields(solrQuery, getAllFacetNames(solrServer));
         return solrQuery;
     }
 
@@ -267,8 +267,10 @@ public class SolrQueryUtil {
      *            {@link SolrQuery} to be updated with the given <code>constraints</code>
      */
     public static void addConstraintsToSolrQuery(Set<Constraint> constraints, SolrQuery solrQuery) {
-        for (Constraint constraint : constraints) {
-            solrQuery.addFilterQuery(constraint.getFacet().getLabel(null), constraint.getValue());
+        if (constraints != null) {
+            for (Constraint constraint : constraints) {
+                solrQuery.addFilterQuery(constraint.getFacet().getLabel(null) + ":" + constraint.getValue());
+            }
         }
     }
 }

Copied: incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentList.java (from r1325635, incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentSet.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentList.java?p2=incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentList.java&p1=incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentSet.java&r1=1325635&r2=1325800&rev=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentSet.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/ConstrainedDocumentList.java Fri Apr 13 15:16:16 2012
@@ -25,9 +25,9 @@ import org.apache.stanbol.contenthub.ser
  * A set of documents that can be narrowed by applying {@link Constraint}s that are grouped by {@link Facet}s.
  * Instances of this class are immutable, narrowing and broadening return new instances.
  */
-public interface ConstrainedDocumentSet {
+public interface ConstrainedDocumentList {
     /**
-     * Returns the documents contained in this {@link ConstrainedDocumentSet}. There is no defined order of
+     * Returns the documents contained in this {@link ConstrainedDocumentList}. There is no defined order of
      * the list, but implementations should keep the order stable as too allow stateless pagination.
      * 
      * Implementations may populate the list just when the respective elements are accessed and implement
@@ -36,7 +36,7 @@ public interface ConstrainedDocumentSet 
      * match the actual number of elements when iterating throw it at a later point in time. The iterate() as
      * well as the subList(int,int) method are safe.
      * 
-     * @return the documents included in this {@link ConstrainedDocumentSet}
+     * @return the documents included in this {@link ConstrainedDocumentList}
      * @throws SearchException
      */
     List<UriRef> getDocuments() throws SearchException;
@@ -53,7 +53,7 @@ public interface ConstrainedDocumentSet 
      * This method returns all possible {@link Facet}s together with all their possible {@link Constraint}s
      * that can be used to filter documents included in this set.
      * 
-     * @return the {@link Facet}s by which this {@link ConstrainedDocumentSet} can be restricted.
+     * @return the {@link Facet}s by which this {@link ConstrainedDocumentList} can be restricted.
      */
     Set<Facet> getFacets();
 
@@ -63,27 +63,27 @@ public interface ConstrainedDocumentSet 
      * 
      * <code>narrow(additionalConstraint).getDocuments().size()</code>
      * 
-     * Creates a new {@link ConstrainedDocumentSet} with the new set of {@link Constraint} which is formed by
+     * Creates a new {@link ConstrainedDocumentList} with the new set of {@link Constraint} which is formed by
      * adding the specified <code>constraint</code> the constraint set returned by {@link #getConstraints()}.
      * 
      * @param constraint
      *            the additional {@link Constraint} to apply
-     * @return the restricted {@link ConstrainedDocumentSet} by applying the given additional
+     * @return the restricted {@link ConstrainedDocumentList} by applying the given additional
      *         <code>constraint</code>
      * @throws SearchException
      */
-    ConstrainedDocumentSet narrow(Constraint constraint) throws SearchException;
+    ConstrainedDocumentList narrow(Constraint constraint) throws SearchException;
 
     /**
-     * Creates a new {@link ConstrainedDocumentSet} with the new set of {@link Constraint}s which is formed by
+     * Creates a new {@link ConstrainedDocumentList} with the new set of {@link Constraint}s which is formed by
      * removing the specified <code>constraint</code> from the constraint set returned by
      * {@link #getConstraints()}.
      * 
      * @param constraint
      *            the {@link Constraint} which must be member of the set returned by {@link #getConstraints()}
-     * @return the broadened {@link ConstrainedDocumentSet} by removing the given <code>constraint</code>.
+     * @return the broadened {@link ConstrainedDocumentList} by removing the given <code>constraint</code>.
      * @throws SearchException
      */
-    ConstrainedDocumentSet broaden(Constraint constraint) throws SearchException;
+    ConstrainedDocumentList broaden(Constraint constraint) throws SearchException;
 
 }

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/Facet.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/Facet.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/Facet.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/Facet.java Fri Apr 13 15:16:16 2012
@@ -19,7 +19,7 @@ import java.util.Locale;
 import java.util.Set;
 
 /**
- * A {@link Facet} is an aspect by which the {@link ConstrainedDocumentSet} can be narrowed. Facets correspond
+ * A {@link Facet} is an aspect by which the {@link ConstrainedDocumentList} can be narrowed. Facets correspond
  * to properties of documents and they are used in the search operations in {@link FeaturedSearch} of
  * Contenthub. Facets are considered as equal if their default labels are the same. Default labels of facets
  * are obtained by providing <code>null</code> to {@link #getLabel(Locale)}.

Modified: incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/FeaturedSearch.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/FeaturedSearch.java?rev=1325800&r1=1325799&r2=1325800&view=diff
==============================================================================
--- incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/FeaturedSearch.java (original)
+++ incubator/stanbol/branches/faceted-browsing/contenthub/servicesapi/src/main/java/org/apache/stanbol/contenthub/servicesapi/search/featured/FeaturedSearch.java Fri Apr 13 15:16:16 2012
@@ -116,9 +116,9 @@ public interface FeaturedSearch {
 
     /**
      * This method searches the given <code>keyword</code> in the default index of Contenthub considering the
-     * given <code>constraints</code>. Results are returned in a {@link ConstrainedDocumentSet} instance and
+     * given <code>constraints</code>. Results are returned in a {@link ConstrainedDocumentList} instance and
      * all search results are returned without considering any <i>offset</i> or <i>limit</i> value.
-     * Furthermore, returned {@link ConstrainedDocumentSet} contains {@link Constraint}s that were used to
+     * Furthermore, returned {@link ConstrainedDocumentList} contains {@link Constraint}s that were used to
      * filter the results and all possible {@link Facet}s that can be used to filter results even more.
      * 
      * @param keyword
@@ -126,17 +126,17 @@ public interface FeaturedSearch {
      * @param constraints
      *            a {@link Set} of {@link Constraint}s to be provided in addition to initial query
      *            <code>keyword</code>
-     * @return an instance of {@link ConstrainedDocumentSet} including the search results and additional
+     * @return an instance of {@link ConstrainedDocumentList} including the search results and additional
      *         {@link Constraint} and {@link Facet} information.
      * @throws SearchException
      */
-    ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints) throws SearchException;
+    ConstrainedDocumentList search(String keyword, Set<Constraint> constraints) throws SearchException;
 
     /**
      * This method searches the given <code>keyword</code> in the Solr index identified by the given
      * <code>indexName</code> considering the given <code>constraints</code>. Results are returned in a
-     * {@link ConstrainedDocumentSet} instance and all search results are returned without considering any
-     * <i>offset</i> or <i>limit</i> value. Furthermore, returned {@link ConstrainedDocumentSet} contains
+     * {@link ConstrainedDocumentList} instance and all search results are returned without considering any
+     * <i>offset</i> or <i>limit</i> value. Furthermore, returned {@link ConstrainedDocumentList} contains
      * {@link Constraint}s that were used to filter the results and all possible {@link Facet}s that can be
      * used to filter results even more.
      * 
@@ -147,17 +147,17 @@ public interface FeaturedSearch {
      *            <code>keyword</code>
      * @param indexName
      *            name of the index (Solr core) on which search will be done
-     * @return an instance of {@link ConstrainedDocumentSet} including the search results and additional
+     * @return an instance of {@link ConstrainedDocumentList} including the search results and additional
      *         {@link Constraint} and {@link Facet} information.
      * @throws SearchException
      */
-    ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints, String indexName) throws SearchException;
+    ConstrainedDocumentList search(String keyword, Set<Constraint> constraints, String indexName) throws SearchException;
 
     /**
      * This method searches the given <code>keyword</code> in the default index of Contenthub considering the
-     * given <code>constraints</code>. Results are returned in a {@link ConstrainedDocumentSet} instance and
+     * given <code>constraints</code>. Results are returned in a {@link ConstrainedDocumentList} instance and
      * search results are selected according to given <code>offset</code> and <code>limit</code> parameters.
-     * This allows pagination on the search results. Furthermore, returned {@link ConstrainedDocumentSet}
+     * This allows pagination on the search results. Furthermore, returned {@link ConstrainedDocumentList}
      * contains {@link Constraint}s that were used to filter the results and all possible {@link Facet}s that
      * can be used to filter results even more.
      * 
@@ -173,18 +173,18 @@ public interface FeaturedSearch {
      *            a subset having the size of this value of all search results for the given
      *            <code>keyword</code> and <code>constraints</code> is obtained starting from
      *            <code>offset</code>.
-     * @return an instance of {@link ConstrainedDocumentSet} including the search results and additional
+     * @return an instance of {@link ConstrainedDocumentList} including the search results and additional
      *         {@link Constraint} and {@link Facet} information.
      * @throws SearchException
      */
-    ConstrainedDocumentSet search(String keyword, Set<Constraint> constraints, int offset, int limit) throws SearchException;
+    ConstrainedDocumentList search(String keyword, Set<Constraint> constraints, int offset, int limit) throws SearchException;
 
     /**
      * This method searches the given <code>keyword</code> in the Solr index identified by the given
      * <code>indexName</code> considering the given <code>constraints</code>. Results are returned in a
-     * {@link ConstrainedDocumentSet} instance and search results are selected according to given
+     * {@link ConstrainedDocumentList} instance and search results are selected according to given
      * <code>offset</code> and <code>limit</code> parameters. This allows pagination on the search results.
-     * Furthermore, returned {@link ConstrainedDocumentSet} contains {@link Constraint}s that were used to
+     * Furthermore, returned {@link ConstrainedDocumentList} contains {@link Constraint}s that were used to
      * filter the results and all possible {@link Facet}s that can be used to filter results even more.
      * 
      * @param keyword
@@ -199,11 +199,11 @@ public interface FeaturedSearch {
      *            a subset having the size of this value of all search results for the given
      *            <code>keyword</code> and <code>constraints</code> is obtained starting from
      *            <code>offset</code>.
-     * @return an instance of {@link ConstrainedDocumentSet} including the search results and additional
+     * @return an instance of {@link ConstrainedDocumentList} including the search results and additional
      *         {@link Constraint} and {@link Facet} information.
      * @throws SearchException
      */
-    ConstrainedDocumentSet search(String keyword,
+    ConstrainedDocumentList search(String keyword,
                                   Set<Constraint> constraints,
                                   String indexName,
                                   int offset,