Class SearchContent

  • Direct Known Subclasses:
    SearchResult

    public class SearchContent
    extends Object
    Represents a set of data to put into the search index, this should represent the data of a single entity which should be indexed into the search engine NOTE: summary is the major piece of content which is being indexed, this may be an entire HTML page or just a bit of text, it is the part that will be searched when normal searches are executed
    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Constructor Detail

      • SearchContent

        protected SearchContent()
      • SearchContent

        public SearchContent​(String id,
                             String prefix,
                             String reference,
                             String title,
                             String url)
        Create a set of content for indexing, NOTE: make sure you also set the summary using setSummary(String) or setSummaryReader(Reader)
        Parameters:
        id - the entity id (e.g. "1234")
        prefix - the entity prefix (e.g. "user")
        reference - the entity reference (e.g. /prefix/id)
        title - the display title for this content
        url - the URL to this content
    • Method Detail

      • setProperty

        public void setProperty​(String name,
                                String value)
        Set any property on this search content
        Parameters:
        name - the key for the property
        value - the value
      • getProperty

        public String getProperty​(String name)
        Get any property from this search content
        Parameters:
        name - the name of the property
        Returns:
        the value OR null if it is not set
      • setSummary

        public void setSummary​(String summary)
      • getSummaryReader

        public Reader getSummaryReader()
      • setSummaryReader

        public void setSummaryReader​(Reader summaryReader)
      • getId

        public String getId()
      • setId

        public void setId​(String id)
      • getPrefix

        public String getPrefix()
      • setPrefix

        public void setPrefix​(String prefix)
      • getReference

        public String getReference()
      • setReference

        public void setReference​(String reference)
      • getTitle

        public String getTitle()
      • setTitle

        public void setTitle​(String title)
      • getUrl

        public String getUrl()
      • setUrl

        public void setUrl​(String url)