Re-wrote free text searching interfaces for Taxon and Description to make them more...
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IReferenceService.java
index 0cf6fa19694f031331cdd0a2b2389dc0859cb636..953ed0a546207af42a726efd9210b187f913b80b 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 /**
 * Copyright (C) 2007 EDIT
 * European Distributed Institute of Taxonomy 
@@ -11,8 +12,8 @@ package eu.etaxonomy.cdm.api.service;
 
 import java.util.Collection;
 import java.util.List;
-import java.util.UUID;
 import java.util.Map;
+import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
@@ -81,4 +82,21 @@ public interface IReferenceService extends IIdentifiableEntityService<ReferenceB
         */
        public abstract Map<UUID, ReferenceBase> saveReferenceAll(Collection<ReferenceBase> referenceCollection);
        
+       /**
+        * Returns a Paged List of ReferenceBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
+        * 
+        * @param clazz filter the results by class (or pass null to return all ReferenceBase instances)
+        * @param queryString
+        * @param pageSize The maximum number of references returned (can be null for all matching references)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+        * @param orderHints
+        *            Supports path like <code>orderHints.propertyNames</code> which
+        *            include *-to-one properties like createdBy.username or
+        *            authorTeam.persistentTitleCache
+        * @param propertyPaths properties to be initialized
+        * @return a Pager ReferenceBase instances
+        * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
+        */
+       public Pager<ReferenceBase> search(Class<? extends ReferenceBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
+       
 }