public class SearchResultModel extends AbstractSTKTemplateModel<info.magnolia.rendering.template.TemplateDefinition>
Modifier and Type | Field and Description |
---|---|
protected long |
count |
protected int |
currentPage |
protected int |
maxResultsPerPage |
protected long |
numPages |
protected Set<javax.jcr.Node> |
queryResult |
protected String |
repository |
protected List<info.magnolia.cms.core.Content> |
result
Deprecated.
since 2.9, please use
queryResult . |
DEFAULT_SITEROOT_TEMPLATE_CATEGORY, stkFunctions, templatingFunctions
Constructor and Description |
---|
SearchResultModel(javax.jcr.Node content,
info.magnolia.rendering.template.TemplateDefinition definition,
info.magnolia.rendering.model.RenderingModel<?> parent,
STKTemplatingFunctions stkFunctions,
info.magnolia.templating.functions.TemplatingFunctions templatingFunctions) |
Modifier and Type | Method and Description |
---|---|
String |
execute()
The query result is filtered by
NodeTypes.Page#NAME type. |
protected String |
generateSimpleQuery(String input) |
int |
getBeginIndex() |
long |
getCount() |
int |
getCurrentPage() |
long |
getEndIndex() |
protected int |
getMaxResultsPerPage() |
long |
getNumPages() |
protected int |
getOffset() |
String |
getPageLink(int i) |
String |
getPath() |
String |
getPosition() |
List<javax.jcr.Node> |
getQueryResult()
Deprecated.
since 2.9, please use
getQueryResult(Iterable) instead. |
Set<javax.jcr.Node> |
getQueryResult(Iterable<javax.jcr.Node> results) |
String |
getQueryStr() |
Collection<SearchResultItem> |
getResult() |
protected int |
pagedQuery(Collection<info.magnolia.cms.core.Content> queryResult,
int offset,
int limit)
Deprecated.
since 2.9, no longer used as the same functionality is achieved in the
execute() method with JCR SQL2. |
getSite, getSiteRoot
getContent, getDef, getDefinition, getNode, getParent, getRoot
protected String repository
protected List<info.magnolia.cms.core.Content> result
queryResult
.protected Set<javax.jcr.Node> queryResult
protected long count
protected int maxResultsPerPage
protected int currentPage
protected long numPages
@Inject public SearchResultModel(javax.jcr.Node content, info.magnolia.rendering.template.TemplateDefinition definition, info.magnolia.rendering.model.RenderingModel<?> parent, STKTemplatingFunctions stkFunctions, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
protected int getMaxResultsPerPage()
public String execute()
NodeTypes.Page#NAME
type.
This is hardly the most efficient way to perform content research in a large production website where one would probably tweak JR's indexing_configuration
to add all relevant content to the search index and perform one single query against it. Or one could resort to a dedicated search service like Solr.execute
in interface info.magnolia.rendering.model.RenderingModel<info.magnolia.rendering.template.TemplateDefinition>
execute
in class info.magnolia.rendering.model.RenderingModelImpl<info.magnolia.rendering.template.TemplateDefinition>
protected int getOffset()
@Deprecated protected int pagedQuery(Collection<info.magnolia.cms.core.Content> queryResult, int offset, int limit) throws Exception
execute()
method with JCR SQL2.Exception
public String getPath()
@Deprecated public List<javax.jcr.Node> getQueryResult()
getQueryResult(Iterable)
instead.public Set<javax.jcr.Node> getQueryResult(Iterable<javax.jcr.Node> results) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public Collection<SearchResultItem> getResult()
public String getQueryStr()
public long getCount()
public int getCurrentPage()
public long getNumPages()
public String getPageLink(int i)
public int getBeginIndex()
public long getEndIndex()
public String getPosition()
Copyright © 2008–2017 Magnolia International Ltd.. All rights reserved.