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.
the search query.
number of documents per page.
the data source index or database name to query.
a tuple consisting of the total number of hits and a document iterator for the given query.
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.
the document id corresponding to the document to annotate.
the label to assign.
the data source index or database name to query.
a models.Tag representing the added tag or if already present the existing tag.
Returns an option value of models.Document associated with the given id.
Returns an option value of models.Document associated with the given id.
the document id to search for.
the data source index or database name to query.
scala.Some if a document with the given id exists. scala.None otherwise.
Returns a list of documents associated with the given tag label.
Returns a list of documents associated with the given tag label.
the tag label to search for.
the data source index or database name to query.
a non-empty list of models.Document, if at least one document annotated with the given label exists. scala.Nil otherwise.
Returns all distinct labels over all annotated models.Tag.
Returns all distinct labels over all annotated models.Tag.
the data source index or database name to query.
a non-empty list of tag labels, if at least one tag is assigned to a document. scala.Nil otherwise.
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.
the document id.
the number of terms to fetch.
the data source index or database name to query.
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.
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.
a list of document ids.
a filter for metadata keys.
the data source index or database name to query.
a list of triple consisting of the document id, the metadata key and metadata value.
Returns all unique metadata keys for the underlying collection.
Returns all unique metadata keys for the underlying collection.
Returns a list of models.Tag associated with the given document id.
Returns a list of models.Tag associated with the given document id.
the document id.
the data source index or database name to query.
a non-empty list of models.Tag, if at least one tag is associated with the given document id. scala.Nil otherwise.
Removes the tag from the document associated with the given id.
Removes the tag from the document associated with the given id.
the tag id associated with a document.
the data source index or database name to query.
true, if the tag is removed successfully. False, in case the the tag does not exist.
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.