Package io.jmix.search.searching.impl
Class SearchResultImpl
java.lang.Object
io.jmix.search.searching.impl.SearchResultImpl
- All Implemented Interfaces:
SearchResult
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Collection<SearchResultEntry>
protected int
protected final Map<String,
Collection<SearchResultEntry>> protected boolean
protected SearchContext
protected SearchStrategy
protected int
protected long
-
Constructor Summary
ConstructorDescriptionSearchResultImpl
(SearchContext searchContext, SearchStrategy searchStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntry
(SearchResultEntry searchResultEntry) Creates 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
.void
boolean
isEmpty()
Checks if there is any data in result.boolean
Checks if there are more objects suitable for next-page search.void
setMoreDataAvailable
(boolean moreDataAvailable) void
setTotalHits
(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:SearchResult
Gets allSearchResultEntry
specific for provided entity.- Specified by:
getEntriesByEntityName
in interfaceSearchResult
- Parameters:
entityName
- entity name- Returns:
- collection of
SearchResultEntry
-
getAllEntries
Description copied from interface:SearchResult
Gets allSearchResultEntry
- Specified by:
getAllEntries
in interfaceSearchResult
- Returns:
- collection of
SearchResultEntry
-
isEmpty
public boolean isEmpty()Description copied from interface:SearchResult
Checks if there is any data in result.- Specified by:
isEmpty
in interfaceSearchResult
- Returns:
- true if this
SearchResult
contains anySearchResultEntry
, false otherwise
-
getEntityNames
Description copied from interface:SearchResult
Gets names of all entities presented in thisSearchResult
.- Specified by:
getEntityNames
in interfaceSearchResult
- Returns:
- collection of entity names
-
getSearchText
Description copied from interface:SearchResult
Gets text search has been performed with.- Specified by:
getSearchText
in interfaceSearchResult
- Returns:
- search text
-
getSize
public int getSize()Description copied from interface:SearchResult
Gets amount of objects in thisSearchResult
- Specified by:
getSize
in interfaceSearchResult
- Returns:
- amount of objects
-
getTotalHits
public long getTotalHits()Description copied from interface:SearchResult
Gets total amount of hits in thisSearchResult
.- Specified by:
getTotalHits
in interfaceSearchResult
- Returns:
- total hits
-
setTotalHits
public void setTotalHits(long totalHits) Description copied from interface:SearchResult
Sets the total number of hits for thisSearchResult
.- Specified by:
setTotalHits
in interfaceSearchResult
- Parameters:
totalHits
- the total number of hits to be set.
-
getEffectiveOffset
public int getEffectiveOffset()Description copied from interface:SearchResult
Gets search offset currently applied to load content of thisSearchResult
including post-load security filtrationUse this offset to perform next-page search.
- Specified by:
getEffectiveOffset
in interfaceSearchResult
- Returns:
- effective offset
-
incrementOffset
public void incrementOffset() -
getSearchContext
Description copied from interface:SearchResult
GetsSearchContext
that was used to gain thisSearchResult
.- Specified by:
getSearchContext
in interfaceSearchResult
- Returns:
SearchContext
-
isMoreDataAvailable
public boolean isMoreDataAvailable()Description copied from interface:SearchResult
Checks if there are more objects suitable for next-page search.- Specified by:
isMoreDataAvailable
in interfaceSearchResult
- Returns:
- true if index contains more suitable data, false otherwise
-
getSearchStrategy
Description copied from interface:SearchResult
GetsSearchStrategy
that was used to gain thisSearchResult
.- Specified by:
getSearchStrategy
in interfaceSearchResult
- Returns:
SearchStrategy
-
createNextPageSearchContext
Description copied from interface:SearchResult
Creates newSearchContext
based on current one and describes next-page search- Specified by:
createNextPageSearchContext
in interfaceSearchResult
- Returns:
SearchContext
-
setMoreDataAvailable
public void setMoreDataAvailable(boolean moreDataAvailable)
-