Interface I_CmsSearchDocument

All Known Implementing Classes:
CmsLuceneDocument, CmsSolrDocument

public interface I_CmsSearchDocument
The interface for search documents.

  • Field Details

  • Method Details

    • addCategoryField

      void addCategoryField(List<CmsCategory> categories)
      Adds the list of the given categories to this document.

      Parameters:
      categories - the categories to add
    • addContentField

      void addContentField(byte[] content)
      Adds the given content byte array to this document.

      Parameters:
      content - the content to add
    • addContentLocales

      Adds the locales of the content to this document.

      Parameters:
      locales - the locales of the content
    • addDateField

      void addDateField(String name, long date, boolean analyzed)
      Puts the given date into the field with the given name.

      Parameters:
      name - the name to put the date in
      date - the date to pu into the field
      analyzed - true if the inserted value should be analyzable
    • addFileSizeField

      void addFileSizeField(int length)
      Adds the given file size as field to this document.

      Parameters:
      length - the length
    • addPathField

      void addPathField(String rootPath)
      Puts the given path into this document.

      Parameters:
      rootPath - the given path into this document
    • addResourceLocales

      Adds the locales of the resource to this document.

      Parameters:
      locales - the locales of the resource
    • addRootPathField

      void addRootPathField(String rootPath)
      Puts the given root path into its default field.

      Parameters:
      rootPath - the root path to put into the field
    • addSearchField

      void addSearchField(CmsSearchField field, String value)
      Adds a dynamic search field to the index.

      Parameters:
      field - the field
      value - the value
    • addSuffixField

      void addSuffixField(String suffix)
      Adds the suffix field to the document. This field should contain the resource suffix.

      Example
      'html' for a file named 'article.html'

      Parameters:
      suffix - the suffix to add
    • addTypeField

      void addTypeField(String type)
      Adds the resource type to this document.

      Parameters:
      type - the resource type name.
    • getContentBlob

      byte[] getContentBlob()
      Returns the content blob of this document.

      Returns:
      the content blob
    • getDocument

      Returns the concrete document as Object to be cast if necessary.

      Returns:
      the document as Object
    • getFieldNames

      Returns all field names of this document.

      Returns:
      the field names
    • getFieldValueAsDate

      Tries to return the value of the field for the given name as Date, null if the field is empty or if the field is not of the type date.

      Parameters:
      fieldName - the name of the field to get the Date value for
      Returns:
      the date or null
    • getFieldValueAsString

      Returns the value of the field for the given name as String.

      Parameters:
      fieldName - the name of the field to get the String value for
      Returns:
      the String value or null if empty
    • getMultivaluedFieldAsStringList

      Returns the values of a multi-valued field as list of strings.
      Parameters:
      fieldName - the name of the multivalued field to get the values from.
      Returns:
      the values of a multi-valued field as list of strings.
    • getPath

      Returns the root path of the referenced VFS resource of this document.

      Returns:
      the root path
    • getScore

      float getScore()
      Returns the score for this document.

      Returns:
      the score
    • getType

      Returns the resource type of the referenced VFS resource of this document.

      Returns:
      the type
    • setScore

      void setScore(float score)
      Sets the score for this document.

      Parameters:
      score - the score