public interface PrefixIndex<T extends Serializable> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
void |
createIndex(Collection<T> models)
Create or recreate prefix index.
|
PrefixIndexListDecorator<T> |
decorateAsList()
Get an instance of
PrefixIndex which also implements the
List interface. |
List<T> |
getAll()
Get all model entries in the index as list (in the same order they were
in the collection iterator on index building).
|
PrefixIndex<T> |
getFilteredView(Predicate<T> filterFunction)
Get a view on the current prefix index which only returns models matching
the given filter predicate.
|
HighlightedString |
getHighlighted(String modelValue,
String query)
Highlight the hits from a prefix query in a model value String.
|
HighlightedString |
getHighlightedHtml(String modelValue,
String query)
Highlight the hits from a prefix query in a model value String with HTML.
|
List<T> |
search(String query)
Search the index for a query string and return a list of indexed models,
which match the query prefix criteria.
|
List<T> |
search(String query,
long maxSize)
Search the index for a query string and return a list of indexed models,
which match the query prefix criteria.
|
List<T> |
searchExact(String query)
Search the index for a query string and return a list of indexed models,
which match the query criteria.
|
Stream<T> |
searchStream(String query)
Search the index for a query string and return a stream of indexed
models, which match the query prefix criteria.
|
void createIndex(Collection<T> models)
models - collection of models to indexStream<T> searchStream(String query)
query - query stringList<T> search(String query)
query - query stringList<T> search(String query, long maxSize)
query - query stringmaxSize - as soon as there are so many entries found, all others are
omittedList<T> searchExact(String query)
query - query stringList<T> getAll()
HighlightedString getHighlighted(String modelValue, String query)
modelValue - value to resolve highlights fromquery - query string with prefixes to be highlightedHighlightedString getHighlightedHtml(String modelValue, String query)
modelValue - value to resolve highlights from (with HTML tags)query - query string with prefixes to be highlightedPrefixIndexListDecorator<T> decorateAsList()
PrefixIndex which also implements the
List interface. The returned instance is completely entangled
with the current object, so that both objects share a state and each trie
operation on one of the objects also affects the other object in the same
way.PrefixIndex<T> getFilteredView(Predicate<T> filterFunction)
filterFunction - filter function to filter search streamCopyright © 2015 illucIT Software GmbH. All rights reserved.