Trait

models.services

DocumentService

Related Doc: package services

Permalink

trait DocumentService extends AnyRef

Defines common data access methods for retrieving and annotating documents.

The trait is implemented by models.services.FinalDocumentService, which uses mixed-in composition in order to combine models.services.DBDocumentService and models.services.ESDocumentService.

Annotations
@ImplementedBy()
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DocumentService
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def addTag(docId: Long, label: String)(index: String): Tag

    Permalink

    Annotates a document with the given label.

    Annotates a document with the given label.

    This function is useful for grouping documents according to a label. Documents associated with the same label belong to the same group. Each tag belongs exactly to one document. However, multiple tags can share the same label. In case the document is already annotated with the given label the existing models.Tag is returned.

    docId

    the document id corresponding to the document to annotate.

    label

    the label to assign.

    index

    the data source index or database name to query.

    returns

    a models.Tag representing the added tag or if already present the existing tag.

  2. abstract def getById(docId: Long)(index: String): Option[Document]

    Permalink

    Returns an option value of models.Document associated with the given id.

    Returns an option value of models.Document associated with the given id.

    docId

    the document id to search for.

    index

    the data source index or database name to query.

    returns

    scala.Some if a document with the given id exists. scala.None otherwise.

  3. abstract def getByTagLabel(label: String)(index: String): List[Document]

    Permalink

    Returns a list of documents associated with the given tag label.

    Returns a list of documents associated with the given tag label.

    label

    the tag label to search for.

    index

    the data source index or database name to query.

    returns

    a non-empty list of models.Document, if at least one document annotated with the given label exists. scala.Nil otherwise.

    See also

    See the method models.services.DocumentService#addTag to annotate documents with tags.

  4. abstract def getDocumentLabels()(index: String): List[String]

    Permalink

    Returns all distinct labels over all annotated models.Tag.

    Returns all distinct labels over all annotated models.Tag.

    index

    the data source index or database name to query.

    returns

    a non-empty list of tag labels, if at least one tag is assigned to a document. scala.Nil otherwise.

  5. abstract def getKeywords(docId: Long, size: Option[Int] = None)(index: String): List[KeyTerm]

    Permalink

    Returns important terms occurring in the document content for the given document id.

    Returns important terms occurring in the document content for the given document id.

    docId

    the document id.

    size

    the number of terms to fetch.

    index

    the data source index or database name to query.

    returns

    a list of models.KeyTerm representing important terms for the given document. scala.Nil if no important term is associated with the given document id.

  6. abstract def getMetadata(docIds: List[Long], fields: List[String])(index: String): List[(Long, String, String)]

    Permalink

    Returns metadata keys and values for the given document ids.

    Returns metadata keys and values for the given document ids.

    The function only returns metadata instances for the given keys in the field parameter.

    docIds

    a list of document ids.

    fields

    a filter for metadata keys.

    index

    the data source index or database name to query.

    returns

    a list of triple consisting of the document id, the metadata key and metadata value.

  7. abstract def getMetadataKeys()(index: String): List[String]

    Permalink

    Returns all unique metadata keys for the underlying collection.

  8. abstract def getTags(docId: Long)(index: String): List[Tag]

    Permalink

    Returns a list of models.Tag associated with the given document id.

    Returns a list of models.Tag associated with the given document id.

    docId

    the document id.

    index

    the data source index or database name to query.

    returns

    a non-empty list of models.Tag, if at least one tag is associated with the given document id. scala.Nil otherwise.

  9. abstract def removeTag(tagId: Int)(index: String): Boolean

    Permalink

    Removes the tag from the document associated with the given id.

    Removes the tag from the document associated with the given id.

    tagId

    the tag id associated with a document.

    index

    the data source index or database name to query.

    returns

    true, if the tag is removed successfully. False, in case the the tag does not exist.

  10. abstract def searchDocuments(facets: Facets, pageSize: Int)(index: String): (Long, Iterator[Document])

    Permalink

    Returns an iterator with documents matching the given search query.

    Returns an iterator with documents matching the given search query.

    The iterator acts lazy and queries for more documents once the number of consumed documents exceeds the page size.

    facets

    the search query.

    pageSize

    number of documents per page.

    index

    the data source index or database name to query.

    returns

    a tuple consisting of the total number of hits and a document iterator for the given query.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped