org.appng.api.search

## Interface Document

- All Superinterfaces:
    Comparable<Document>, Observable<Document>
  All Known Implementing Classes:
    SimpleDocument

      public interface Document
      extends Observable<Document>, Comparable<Document>

  A `Document` is tracked by the Lucene searchindex. It implements `Observable` so it can notify an `Observer` of changes.
  A Lucene `Document` is being created from a `Document` instance, which is then being added/updated/deleted from/to the index, depending on the `DocumentEvent` passed to `DocumentProducer``#put({@link DocumentEvent})`.

  TODO appng-search is the better place for this

  Author:
    Matthias Müller
  See Also:
    `DocumentProducer`, `DocumentEvent`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.appng.api.observe.Observable

      `Observable.Event`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Observable.Event` | `CREATE` Event indicating a `Document` has been created.
    `static Observable.Event` | `DELETE` Event indicating a `Document` has been deleted.
    `static String` | `FIELD_CONTENT`
    `static String` | `FIELD_DATE`
    `static String` | `FIELD_ID`
    `static String` | `FIELD_IMAGE`
    `static String` | `FIELD_LANGUAGE`
    `static String` | `FIELD_PATH`
    `static String` | `FIELD_TEASER`
    `static String` | `FIELD_TITLE`
    `static String` | `FIELD_TYPE`
    `static Observable.Event` | `UPDATE` Event indicating a `Document` has been updated.
    `static String` | `YYYY_MM_DD_HH_MM_SS`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterable<org.apache.lucene.index.IndexableField>` | `getAdditionalFields()` Returns some additionally `IndexableField`s (if any) to be added to the `Document` which is being created from this `Document`.
    `String` | `getContent()` Returns the content to be indexed.
    `Date` | `getDate()` Returns the `Date` of the last modification of this `Document`.
    `String` | `getDescription()` Returns the description of this `Document`.
    `int` | `getDocId()`
    `org.apache.lucene.index.IndexableField` | `getField(String string)`
    `String` | `getFragment()`
    `String` | `getId()` Returns the ID of this `Document`. Has to be globally unique, speaking in the scope of a `Site`, since each site has it's own searchindex.
    `String` | `getImage()`
    `String` | `getLanguage()` Returns the language of this `Document`.
    `String` | `getName()` Returns the name of this `Document`.
    `String` | `getPath()` Returns the path of this `Document`, relative to the `Site`s domain.
    `float` | `getScore()`
    `String` | `getType()` Returns the type of this `Document`, to be used when searching `Document`s of a certain type.
    `void` | `setFragment(String fragment)`

    - ### Methods inherited from interface org.appng.api.observe.Observable

      `addObserver, notifyObservers, removeObserver`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Field Detail

    - #### FIELD_PATH

          static final String FIELD_PATH

      See Also:
        Constant Field Values

    - #### FIELD_TITLE

          static final String FIELD_TITLE

      See Also:
        Constant Field Values

    - #### FIELD_TEASER

          static final String FIELD_TEASER

      See Also:
        Constant Field Values

    - #### FIELD_IMAGE

          static final String FIELD_IMAGE

      See Also:
        Constant Field Values

    - #### FIELD_DATE

          static final String FIELD_DATE

      See Also:
        Constant Field Values

    - #### FIELD_TYPE

          static final String FIELD_TYPE

      See Also:
        Constant Field Values

    - #### FIELD_LANGUAGE

          static final String FIELD_LANGUAGE

      See Also:
        Constant Field Values

    - #### FIELD_CONTENT

          static final String FIELD_CONTENT

      See Also:
        Constant Field Values

    - #### FIELD_ID

          static final String FIELD_ID

      See Also:
        Constant Field Values

    - #### YYYY_MM_DD_HH_MM_SS

          static final String YYYY_MM_DD_HH_MM_SS

      See Also:
        Constant Field Values

    - #### CREATE

          static final Observable.Event CREATE

      Event indicating a `Document` has been created.

    - #### UPDATE

          static final Observable.Event UPDATE

      Event indicating a `Document` has been updated.

    - #### DELETE

          static final Observable.Event DELETE

      Event indicating a `Document` has been deleted.

  - ### Method Detail

    - #### getId

          String getId()

      Returns the ID of this `Document`.
      Has to be globally unique, speaking in the scope of a `Site`, since each site has it's own searchindex.
      Returns:
        the ID

    - #### getName

          String getName()

      Returns the name of this `Document`.
      Returns:
        the name

    - #### getDate

          Date getDate()

      Returns the `Date` of the last modification of this `Document`.
      Returns:
        the `Date` of the last modification of this `Document`

    - #### getDescription

          String getDescription()

      Returns the description of this `Document`.
      Returns:
        the description of this `Document`

    - #### getImage

          String getImage()

    - #### getPath

          String getPath()

      Returns the path of this `Document`, relative to the `Site`s domain.
      Returns:
        the path of this `Document`, relative to the `Site`s domain

    - #### getContent

          String getContent()

      Returns the content to be indexed.
      Returns:
        the content to be indexed

    - #### getType

          String getType()

      Returns the type of this `Document`, to be used when searching `Document`s of a certain type.
      Returns:
        the type

    - #### getLanguage

          String getLanguage()

      Returns the language of this `Document`.
      Returns:
        the language

    - #### getAdditionalFields

          Iterable<org.apache.lucene.index.IndexableField> getAdditionalFields()

      Returns some additionally `IndexableField`s (if any) to be added to the `Document` which is being created from this `Document`.
      Returns:
        some `IndexableField`s

    - #### getField

          org.apache.lucene.index.IndexableField getField(String string)

    - #### getScore

          float getScore()

    - #### getDocId

          int getDocId()

    - #### getFragment

          String getFragment()

    - #### setFragment

          void setFragment(String fragment)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.