public interface ISearchableDao<T extends CdmBase>
Modifier and Type | Method and Description |
---|---|
long |
count(java.lang.Class<? extends T> clazz,
java.lang.String queryString)
Returns a count of T instances where entities match a given queryString (as interpreted by the Lucene QueryParser)
|
void |
optimizeIndex()
Calls optimize on the relevant index (useful periodically to increase response times on the free-text search)
|
void |
purgeIndex()
Removes all entities of type T from the index
|
void |
rebuildIndex()
Index all T entities currently in the database (useful in concert with purgeIndex() to (re-)create
indexes or in the case of corrupt indexes / mismatch between
the database and the free-text indices)
|
java.util.List<T> |
search(java.lang.Class<? extends T> clazz,
java.lang.String queryString,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Returns a List of T instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
java.lang.String |
suggestQuery(java.lang.String string)
Suggest a query that will return hits based upon an existing lucene query string (that is presumably misspelt and returns no hits)
Used to implement "did you mean?"-type functionality using the lucene spellchecker.
|
long count(java.lang.Class<? extends T> clazz, java.lang.String queryString)
clazz
- filter the results by class (or pass null to count all entities of type T)queryString
- java.util.List<T> search(java.lang.Class<? extends T> clazz, java.lang.String queryString, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
clazz
- filter the results by class (or pass null to return all entities of type T)queryString
- pageSize
- The maximum number of entities returned (can be null for all matching entities)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)orderHints
- Supports path like orderHints.propertyNames
which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCachepropertyPaths
- properties to be initializedjava.lang.String suggestQuery(java.lang.String string)
string
- Query string to checkvoid purgeIndex()
void rebuildIndex()
void optimizeIndex()
Copyright © 2007-2020 EDIT. All Rights Reserved.