diff --git a/include/search_renderer.h b/include/search_renderer.h index 673e31ebe..b16567ee1 100644 --- a/include/search_renderer.h +++ b/include/search_renderer.h @@ -49,10 +49,24 @@ class SearchRenderer /** * Construct a SearchRenderer from a SearchResultSet. * + * The constructed version of the SearchRendered will not introduce + * the book name for each result. It is better to use the another constructor + * with a Library pointer to have a better html page. + * * @param srs The `SearchResultSet` to render. * @param mapper The `NameMapper` to use to do the rendering. - * @param library The `Library` to use to look up book details for search - * results + * @param start The start offset used for the srs. + * @param estimatedResultCount The estimatedResultCount of the whole search + */ + SearchRenderer(zim::SearchResultSet srs, NameMapper* mapper, + unsigned int start, unsigned int estimatedResultCount); + + /** + * Construct a SearchRenderer from a SearchResultSet. + * + * @param srs The `SearchResultSet` to render. + * @param mapper The `NameMapper` to use to do the rendering. + * @param library The `Library` to use to look up book details for search results. * @param start The start offset used for the srs. * @param estimatedResultCount The estimatedResultCount of the whole search */ diff --git a/src/search_renderer.cpp b/src/search_renderer.cpp index 4b6b8e90b..08f09a1ed 100644 --- a/src/search_renderer.cpp +++ b/src/search_renderer.cpp @@ -47,6 +47,11 @@ SearchRenderer::SearchRenderer(Searcher* searcher, NameMapper* mapper) resultStart(searcher->getResultStart()) {} +SearchRenderer::SearchRenderer(zim::SearchResultSet srs, NameMapper* mapper, + unsigned int start, unsigned int estimatedResultCount) + : SearchRenderer(srs, mapper, nullptr, start, estimatedResultCount) +{} + SearchRenderer::SearchRenderer(zim::SearchResultSet srs, NameMapper* mapper, Library* library, unsigned int start, unsigned int estimatedResultCount) : m_srs(srs),