Interface Hit


public interface Hit
Hit represents a single search result, ie. a node and resource.
  • Method Details

    • getIndex

      long getIndex()
      Returns:
      the zero based index for this hit in the query result.
    • getExcerpts

      Map<String,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

      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

      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 the jcr: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

      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)