Trait

models.services

DBDocumentService

Related Doc: package services

Permalink

trait DBDocumentService extends DocumentService

Partial implementation of models.services.DocumentService using a relational database.

Retrieving large documents via ES is slow. We therefore use the database to fetch documents. Further, user-generated data like tags are stored in the database as well.

Linear Supertypes
DocumentService, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DBDocumentService
  2. DocumentService
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. 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.

    Definition Classes
    DocumentService

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. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  5. final def asInstanceOf[T0]: T0

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

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  11. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  14. def getKeywords(docId: Long, size: Option[Int])(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.

    Definition Classes
    DBDocumentServiceDocumentService
  15. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  16. def getMetadataKeys()(index: String): List[String]

    Permalink

    Returns all unique metadata keys for the underlying collection.

    Returns all unique metadata keys for the underlying collection.

    Definition Classes
    DBDocumentServiceDocumentService
  17. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  18. def hashCode(): Int

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  23. 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.

    Definition Classes
    DBDocumentServiceDocumentService
  24. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from DocumentService

Inherited from AnyRef

Inherited from Any

Ungrouped