Package io.jmix.search.searching
Interface SearchResult
- All Known Implementing Classes:
SearchResultImpl
public interface SearchResult
Represents result of search by some text.
-
Method Summary
Modifier and TypeMethodDescriptionCreates newSearchContext
based on current one and describes next-page searchGets allSearchResultEntry
int
Gets search offset currently applied to load content of thisSearchResult
including post-load security filtrationGets names of all entities presented in thisSearchResult
.getEntriesByEntityName
(String entityName) Gets allSearchResultEntry
specific for provided entity.GetsSearchContext
that was used to gain thisSearchResult
.GetsSearchStrategy
that was used to gain thisSearchResult
.Gets text search has been performed with.int
getSize()
Gets amount of objects in thisSearchResult
long
Gets total amount of hits in thisSearchResult
.boolean
isEmpty()
Checks if there is any data in result.boolean
Checks if there are more objects suitable for next-page search.void
setTotalHits
(long totalHits) Sets the total number of hits for thisSearchResult
.
-
Method Details
-
getSize
int getSize()Gets amount of objects in thisSearchResult
- Returns:
- amount of objects
-
getEffectiveOffset
int getEffectiveOffset()Gets search offset currently applied to load content of thisSearchResult
including post-load security filtrationUse this offset to perform next-page search.
- Returns:
- effective offset
-
getTotalHits
long getTotalHits()Gets total amount of hits in thisSearchResult
.- Returns:
- total hits
-
setTotalHits
void setTotalHits(long totalHits) Sets the total number of hits for thisSearchResult
.- Parameters:
totalHits
- the total number of hits to be set.
-
getEntityNames
Collection<String> getEntityNames()Gets names of all entities presented in thisSearchResult
.- Returns:
- collection of entity names
-
getEntriesByEntityName
Gets allSearchResultEntry
specific for provided entity.- Parameters:
entityName
- entity name- Returns:
- collection of
SearchResultEntry
-
getAllEntries
Collection<SearchResultEntry> getAllEntries()Gets allSearchResultEntry
- Returns:
- collection of
SearchResultEntry
-
getSearchText
String getSearchText()Gets text search has been performed with.- Returns:
- search text
-
getSearchContext
SearchContext getSearchContext()GetsSearchContext
that was used to gain thisSearchResult
.- Returns:
SearchContext
-
isEmpty
boolean isEmpty()Checks if there is any data in result.- Returns:
- true if this
SearchResult
contains anySearchResultEntry
, false otherwise
-
isMoreDataAvailable
boolean isMoreDataAvailable()Checks if there are more objects suitable for next-page search.- Returns:
- true if index contains more suitable data, false otherwise
-
getSearchStrategy
SearchStrategy getSearchStrategy()GetsSearchStrategy
that was used to gain thisSearchResult
.- Returns:
SearchStrategy
-
createNextPageSearchContext
SearchContext createNextPageSearchContext()Creates newSearchContext
based on current one and describes next-page search- Returns:
SearchContext
-