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 newSearchContextbased on current one and describes next-page searchGets allSearchResultEntryintGets search offset currently applied to load content of thisSearchResultincluding post-load security filtrationGets names of all entities presented in thisSearchResult.getEntriesByEntityName(String entityName) Gets allSearchResultEntryspecific for provided entity.GetsSearchContextthat was used to gain thisSearchResult.GetsSearchStrategythat was used to gain thisSearchResult.Gets text search has been performed with.intgetSize()Gets amount of objects in thisSearchResultlongGets total amount of hits in thisSearchResult.booleanisEmpty()Checks if there is any data in result.booleanChecks if there are more objects suitable for next-page search.voidsetTotalHits(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 thisSearchResultincluding 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 allSearchResultEntryspecific 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()GetsSearchContextthat was used to gain thisSearchResult.- Returns:
SearchContext
-
isEmpty
boolean isEmpty()Checks if there is any data in result.- Returns:
- true if this
SearchResultcontains 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()GetsSearchStrategythat was used to gain thisSearchResult.- Returns:
SearchStrategy
-
createNextPageSearchContext
SearchContext createNextPageSearchContext()Creates newSearchContextbased on current one and describes next-page search- Returns:
SearchContext
-