public interface SearchResultPage extends Iterable<SearchHit>
page
of a search-result
. The
total
hits
are split into pages from 0
to
getPageCount()
- 1
. This instance is the getPageIndex()
.th page and has
getPageHitCount()
hits that can be accessed via getPageHit(int)
. They represent the
hits
from getPageCount()
*getHitsPerPage()
to getPageCount()
*getHitsPerPage()
+getPageHitCount()
-1
search
result
. To get hits of a previous or next page, you have to perform
a new search.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HITS_PER_PAGE
The default number of
hits per page . |
Modifier and Type | Method and Description |
---|---|
int |
getHitEndNumber()
This method gets the absolute number of the last hit of this page.
|
int |
getHitsPerPage()
|
int |
getHitStartNumber()
This method gets the absolute number of the first hit of this page.
|
int |
getPageCount()
This method gets the number of pages used to split the
total hits. |
SearchHit |
getPageHit(int index)
|
int |
getPageHitCount()
This method get the number of
hits in the page represented by this
search result . |
int |
getPageIndex()
This method gets the index of the page represented by this
search result , where
0 is the first page and is the last page. |
int |
getPagingEndIndex(int pagingRange)
This method gets the
page-index of the end page when a
number (pagingRange*2)+1 links should be rendered for paging. |
int |
getPagingStartIndex(int pagingRange)
This method gets the
page-index of the start page when a
number (pagingRange*2)+1 links should be rendered for paging. |
String |
getQuery()
This method gets the original query string that produced this result.
|
int |
getTotalHitCount()
This method gets the total number of hits for this
query . |
forEach, iterator, spliterator
static final int DEFAULT_HITS_PER_PAGE
hits per page
.String getQuery()
int getTotalHitCount()
query
.int getHitsPerPage()
DEFAULT_HITS_PER_PAGE
int getPageCount()
total
hits. An empty
search result will have one empty page.int getPageIndex()
search result
, where
0
is the first page and getPageCount()
- 1
is the last page.int getHitStartNumber()
getPageIndex()
*getHitsPerPage()
+ 1
hit
of this page.int getHitEndNumber()
getHitStartNumber()
+getPageHitCount()
hit
of this page.int getPageHitCount()
hits
in the page represented by this
search result
. The value may be less than the number of
hits per page
if this is the last
page
. The value will be greater than zero, except for the first page
that may have a page hit count
of 0
if the
search query
produced no hits.SearchHit getPageHit(int index)
hit
of this page
at the given
index
. index
is relative to this page
. The absolute
index of the hit
is
getPageIndex()
*getHitsPerPage()
+index
.index
- is the index of the requested hit. It has to be in the range from 0
to
getPageHitCount()
- 1
.hit
.int getPagingStartIndex(int pagingRange)
page-index
of the start page
when a
number (pagingRange*2)+1
links should be rendered for paging. The pagingRange
actually specifies the number of links forward and backwards. result-pages
is potentially NOT limited. To avoid that your GUI
layout gets broken by too many paging links, you can use this method to render a fixed number of paging
links. pagingCount
is 2 and you would have a page-count
of e.g.
10
. Then you would render links for visiting the pages from 0
to 4
if your page-index
is 0
,1
, or 2
. For a
page-index
of 3
, you would render the links from 1
to
5
and so on. pagingRange
- the number of paging links forward and backwards.page-index
to start paging with.getPagingEndIndex(int)
int getPagingEndIndex(int pagingRange)
page-index
of the end page
when a
number (pagingRange*2)+1
links should be rendered for paging. The pagingRange
actually specifies the number of links forward and backwards. result-pages
is potentially NOT limited. To avoid that your GUI
layout gets broken by too many paging links, you can use this method to render a fixed number of paging
links. pagingCount
is 2 and you would have a page-count
of e.g.
10
. Then you would render links for visiting the pages from 5
to 9
if your page-index
is 7
,8
, or 9
. For a
page-index
of 6
, you would render the links from 4
to
8
and so on. pagingRange
- the number of paging links forward and backwards.page-index
to end paging with.getPagingStartIndex(int)
Copyright © 2001–2016 mmm-Team. All rights reserved.