Interface Document

All Known Implementing Classes:
LuceneDocument, OpenSearchDocument

@PublicApi public interface Document
A document that is retrieved from the index via IndexSearcher.
Since:
10.4
  • Method Details

    • getId

      String getId()
      Returns:
      the document ID
    • getFieldNames

      Collection<String> getFieldNames()
    • getDate

      Optional<Date> getDate(String fieldName)
      Retrieves a date (date and time, support for time-zone).
      Parameters:
      fieldName - the name of the field
      Returns:
      a date
      Since:
      11.0
    • getDates

      List<Date> getDates(String fieldName)
      Retrieves dates (date and time, support for time-zone).
      Parameters:
      fieldName - the name of the field
      Returns:
      dates
      Since:
      11.0
    • getLocalDate

      Optional<LocalDate> getLocalDate(String fieldName)
      Retrieves a local date (date only, time-zone independent)
      Parameters:
      fieldName - the name of the field
      Returns:
      a local date
      Since:
      11.0
    • getLocalDates

      List<LocalDate> getLocalDates(String fieldName)
      Retrieves local dates (date only, time-zone independent)
      Parameters:
      fieldName - the name of the field
      Returns:
      local dates
      Since:
      11.0
    • getString

      Optional<String> getString(String fieldName)
    • getStrings

      List<String> getStrings(String fieldName)
    • getNumber

      Optional<Number> getNumber(String fieldName)
    • getNumbers

      List<Number> getNumbers(String fieldName)
    • get

      default <T> List<T> get(TypedField<T> field)
    • getValue

      default <T> Optional<T> getValue(FieldValueLoader<T> loader)
    • getValues

      default <T> List<T> getValues(FieldValueLoader<T> loader)