Package com.day.cq.search.result
Interface Hit
-
public interface Hit
Hit
represents a single search result, ie. a node and resource.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getExcerpt()
java.util.Map<java.lang.String,java.lang.String>
getExcerpts()
long
getIndex()
Node
getNode()
java.lang.String
getPath()
ValueMap
getProperties()
Returns either the properties of thejcr:content
subnode (if present) or the properties of this node itself.Resource
getResource()
double
getScore()
Returns the full text search score for this hit.java.lang.String
getTitle()
Returns the title for this hit.
-
-
-
Method Detail
-
getIndex
long getIndex()
- Returns:
- the zero based index for this hit in the query result.
-
getExcerpts
java.util.Map<java.lang.String,java.lang.String> getExcerpts() throws RepositoryException
- Returns:
- a map with excerpts on the jcr:content node of a page.
- Throws:
RepositoryException
- if an error occurs while building the map.
-
getExcerpt
java.lang.String getExcerpt() throws RepositoryException
- Returns:
- the default excerpt for this hit.
- Throws:
RepositoryException
- if an error occurs while building the excerpt.
-
getResource
Resource getResource() throws RepositoryException
- Returns:
- the resource this hit represents.
- Throws:
RepositoryException
- if an error occurs while reading from the query result.
-
getNode
Node getNode() throws RepositoryException
- Returns:
- the node behind this hit
- Throws:
RepositoryException
- if an error occurs while reading from the repository.- Since:
- 5.2
-
getPath
java.lang.String getPath() throws RepositoryException
- Returns:
- the path of the current hit.
- Throws:
RepositoryException
- if an error occurs while reading from the query result.
-
getProperties
ValueMap getProperties() throws RepositoryException
Returns either the properties of thejcr:content
subnode (if present) or the properties of this node itself.- Returns:
- the properties on this hit
- Throws:
RepositoryException
- if an error occurs while reading from the repository.- Since:
- 5.2 (previously returned a plain
Map
)
-
getTitle
java.lang.String getTitle() throws RepositoryException
Returns the title for this hit. The returned string may contain HTML tags, which means it must not be escaped when written to the response.- Returns:
- the title for this hit.
- Throws:
RepositoryException
- if an error occurs while reading form the repository.
-
getScore
double getScore() throws RepositoryException
Returns the full text search score for this hit.- Returns:
- a double.
- Throws:
RepositoryException
- if an error occurs while reading form the repository.- Since:
- 6.0 (bundle version 5.7.2, package version 1.1.0)
-
-