Class CmsSearchResult

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Date m_dateCreated
      The creation date of this search result.
      protected java.util.Date m_dateLastModified
      The last modification date of this search result.
      protected java.lang.String m_documentType
      The document type of the search result.
      protected java.lang.String m_excerpt
      The excerpt of this search result.
      protected java.util.Map<java.lang.String,​java.lang.String> m_fields
      Holds the values of the search result fields.
      protected java.lang.String m_path
      The resource path of this search result.
      protected int m_score
      The score of this search result.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CmsSearchResult()
      Empty constructor to be used for overriding classes.
        CmsSearchResult​(int score, org.apache.lucene.document.Document doc, java.lang.String excerpt)
      Creates a new search result.
    • Field Detail

      • m_dateCreated

        protected java.util.Date m_dateCreated
        The creation date of this search result.
      • m_dateLastModified

        protected java.util.Date m_dateLastModified
        The last modification date of this search result.
      • m_documentType

        protected java.lang.String m_documentType
        The document type of the search result.
      • m_excerpt

        protected java.lang.String m_excerpt
        The excerpt of this search result.
      • m_fields

        protected java.util.Map<java.lang.String,​java.lang.String> m_fields
        Holds the values of the search result fields.
      • m_path

        protected java.lang.String m_path
        The resource path of this search result.
      • m_score

        protected int m_score
        The score of this search result.
    • Constructor Detail

      • CmsSearchResult

        public CmsSearchResult​(int score,
                               org.apache.lucene.document.Document doc,
                               java.lang.String excerpt)
        Creates a new search result.

        Parameters:
        score - the score of this search result
        doc - the Lucene document to extract fields from such as description, title, key words etc. pp.
        excerpt - the excerpt of the search result's content
      • CmsSearchResult

        protected CmsSearchResult()
        Empty constructor to be used for overriding classes.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • getDateCreated

        public java.util.Date getDateCreated()
        Returns the date created.

        Returns:
        the date created
      • getDateLastModified

        public java.util.Date getDateLastModified()
        Returns the date last modified.

        Returns:
        the date last modified
      • getDocumentType

        public java.lang.String getDocumentType()
        Returns the document type of the search result document.

        Usually this will be a VFS resource type String that can be used in the resource type manager with CmsResourceManager.getResourceType(String). However, what is stored in the document type field depends only on the indexer used, and therefore it may also be some String not referring a VFS resource type but some external type or application. It may also be null in case it has not been set by a non-standard indexer.

        Returns:
        the document type of the search result document
        See Also:
        CmsResourceManager.getResourceType(String)
      • getExcerpt

        public java.lang.String getExcerpt()
        Returns the excerpt.

        Returns:
        the excerpt
      • getField

        public java.lang.String getField​(java.lang.String fieldName)
        Returns the text stored in the search index field with the given name.

        Parameters:
        fieldName - the name of the field to get the stored text for
        Returns:
        the text stored in the search index field with the given name
      • getPath

        public java.lang.String getPath()
        Returns the path.

        Returns:
        the path
      • getScore

        public int getScore()
        Returns the score.

        Returns:
        the score
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()