Package io.jmix.search.searching.impl
Class SearchResultImpl
java.lang.Object
io.jmix.search.searching.impl.SearchResultImpl
- All Implemented Interfaces:
SearchResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<SearchResultEntry>protected intprotected final Map<String,Collection<SearchResultEntry>> protected booleanprotected SearchContextprotected SearchStrategyprotected intprotected long -
Constructor Summary
ConstructorsConstructorDescriptionSearchResultImpl(SearchContext searchContext, SearchStrategy searchStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(SearchResultEntry searchResultEntry) Creates 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.voidbooleanisEmpty()Checks if there is any data in result.booleanChecks if there are more objects suitable for next-page search.voidsetMoreDataAvailable(boolean moreDataAvailable) voidsetTotalHits(long totalHits) Sets the total number of hits for thisSearchResult.
-
Field Details
-
searchContext
-
entriesByEntityName
-
allEntries
-
size
protected int size -
totalHits
protected long totalHits -
effectiveOffset
protected int effectiveOffset -
moreDataAvailable
protected boolean moreDataAvailable -
searchStrategy
-
-
Constructor Details
-
SearchResultImpl
-
-
Method Details
-
addEntry
-
getEntriesByEntityName
Description copied from interface:SearchResultGets allSearchResultEntryspecific for provided entity.- Specified by:
getEntriesByEntityNamein interfaceSearchResult- Parameters:
entityName- entity name- Returns:
- collection of
SearchResultEntry
-
getAllEntries
Description copied from interface:SearchResultGets allSearchResultEntry- Specified by:
getAllEntriesin interfaceSearchResult- Returns:
- collection of
SearchResultEntry
-
isEmpty
public boolean isEmpty()Description copied from interface:SearchResultChecks if there is any data in result.- Specified by:
isEmptyin interfaceSearchResult- Returns:
- true if this
SearchResultcontains anySearchResultEntry, false otherwise
-
getEntityNames
Description copied from interface:SearchResultGets names of all entities presented in thisSearchResult.- Specified by:
getEntityNamesin interfaceSearchResult- Returns:
- collection of entity names
-
getSearchText
Description copied from interface:SearchResultGets text search has been performed with.- Specified by:
getSearchTextin interfaceSearchResult- Returns:
- search text
-
getSize
public int getSize()Description copied from interface:SearchResultGets amount of objects in thisSearchResult- Specified by:
getSizein interfaceSearchResult- Returns:
- amount of objects
-
getTotalHits
public long getTotalHits()Description copied from interface:SearchResultGets total amount of hits in thisSearchResult.- Specified by:
getTotalHitsin interfaceSearchResult- Returns:
- total hits
-
setTotalHits
public void setTotalHits(long totalHits) Description copied from interface:SearchResultSets the total number of hits for thisSearchResult.- Specified by:
setTotalHitsin interfaceSearchResult- Parameters:
totalHits- the total number of hits to be set.
-
getEffectiveOffset
public int getEffectiveOffset()Description copied from interface:SearchResultGets search offset currently applied to load content of thisSearchResultincluding post-load security filtrationUse this offset to perform next-page search.
- Specified by:
getEffectiveOffsetin interfaceSearchResult- Returns:
- effective offset
-
incrementOffset
public void incrementOffset() -
getSearchContext
Description copied from interface:SearchResultGetsSearchContextthat was used to gain thisSearchResult.- Specified by:
getSearchContextin interfaceSearchResult- Returns:
SearchContext
-
isMoreDataAvailable
public boolean isMoreDataAvailable()Description copied from interface:SearchResultChecks if there are more objects suitable for next-page search.- Specified by:
isMoreDataAvailablein interfaceSearchResult- Returns:
- true if index contains more suitable data, false otherwise
-
getSearchStrategy
Description copied from interface:SearchResultGetsSearchStrategythat was used to gain thisSearchResult.- Specified by:
getSearchStrategyin interfaceSearchResult- Returns:
SearchStrategy
-
createNextPageSearchContext
Description copied from interface:SearchResultCreates newSearchContextbased on current one and describes next-page search- Specified by:
createNextPageSearchContextin interfaceSearchResult- Returns:
SearchContext
-
setMoreDataAvailable
public void setMoreDataAvailable(boolean moreDataAvailable)
-