Trait

models.services

AggregateService

Related Doc: package services

Permalink

trait AggregateService extends AnyRef

Defines common data access methods for generating aggregated data based on a search query.

The search query is given as models.Facets. The service builds analytic information over a set of documents and provides the result as models.Aggregation. Such a models.Aggregation consists of a list of models.Bucket, where each bucket is associated with a key and the number of documents that match the given search query. The trait further supports mechanisms to exclude and include specific keys.

The trait is implemented by models.services.ESAggregateService, which uses an elasticsearch index as backend.

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

Abstract Value Members

  1. abstract def aggregate(facets: Facets, aggregateKey: String, size: Int, include: List[String], exclude: List[String])(index: String): Aggregation

    Permalink

    Creates multiple buckets - one per unique value that is associated with the given key.

    Creates multiple buckets - one per unique value that is associated with the given key.

    The following snippet will create five buckets. Each bucket represents one of the five most occurring recipient names that are associated with a document and match the empty filter:

    aggregate(Facets.empty, "Recipient_names", 5, Nil, Nil)("enron")

    Use models.services.DocumentService#getMetadataKeys in order to retrieve the available aggregation keys for the underlying collection.

    facets

    the search query.

    aggregateKey

    the key that belongs to the aggregated values.

    size

    the number of unique models.MetaDataBucket to create.

    include

    a list of values to filter the result. The result will only contain the models.MetaDataBucket associated with one of the keys given in this list. The size parameter is ignored when given a non empty include list.

    exclude

    a list of values that should be excluded from the result. The result will contain no models.MetaDataBucket associated with one of the keys given in this list.

    index

    the data source index or database name to query.

    returns

    an instance of models.Aggregation with size models.MetaDataBucket matching the given filters and using the aggregationKey.

  2. abstract def aggregateAll(facets: Facets, size: Int, keyExclusion: List[String])(index: String): List[Aggregation]

    Permalink

    Creates multiple aggregations - one for each metadata from the underlying collection.

    Creates multiple aggregations - one for each metadata from the underlying collection.

    facets

    the search query.

    size

    the number of unique models.MetaDataBucket to create. The size is the same for all aggregations.

    keyExclusion

    a list of metadata keys that should be excluded from the aggregation.

    index

    the data source index or database name to query.

    returns

    a list of models.Aggregation. Each with size models.MetaDataBucket matching the given filters.

  3. abstract def aggregateEntities(facets: Facets, size: Int, include: List[Long], exclude: List[Long])(index: String): Aggregation

    Permalink

    Creates multiple buckets - one per unique entity.

    Creates multiple buckets - one per unique entity.

    Each document has a list of co-occurring entities, which is used to build this aggregation.

    The following snippet will create five buckets. Each bucket represents one of the five most occurring entity ids that are associated with a document and match the empty filter:

    aggregateEntities(Facets.empty, 5, Nil, Nil)("enron")
    facets

    the search query.

    size

    the number of unique models.NodeBucket to create.

    include

    a list of values to filter the result. The result will only contain the models.NodeBucket associated with one of the keys given in this list. The size parameter is ignored when given a non empty include list.

    exclude

    a list of values that should be excluded from the result. The result will contain no models.NodeBucket associated with one of the keys given in this list.

    index

    the data source index or database name to query.

    returns

    an instance of models.Aggregation with size models.NodeBucket representing most occurring entities in the underlying collection.

  4. abstract def aggregateEntitiesByType(facets: Facets, etype: String, size: Int, include: List[Long], exclude: List[Long])(index: String): Aggregation

    Permalink

    Creates multiple buckets - one per unique entity.

    Creates multiple buckets - one per unique entity. The aggregation only considers entities belonging to the given type.

    facets

    the search query.

    etype

    the entity type to filter for.

    size

    the number of unique models.NodeBucket to create.

    include

    a list of values to filter the result. The result will only contain the models.NodeBucket associated with one of the keys given in this list. The size parameter is ignored when given a non empty include list.

    exclude

    a list of values that should be excluded from the result. The result will contain no models.NodeBucket associated with one of the keys given in this list.

    index

    the data source index or database name to query.

    returns

    an instance of models.Aggregation with size models.NodeBucket representing most occurring entities of the given type in the underlying collection.

  5. abstract def aggregateKeywords(facets: Facets, size: Int, include: List[String], exclude: List[String])(index: String): Aggregation

    Permalink

    Creates multiple buckets - one per unique keyword.

    Creates multiple buckets - one per unique keyword.

    Each document has a list important keywords, which is used to build this aggregation.

    facets

    the search query.

    size

    the number of unique models.MetaDataBucket to create.

    include

    a list of values to filter the result. The result will only contain the models.MetaDataBucket associated with one of the keys given in this list. The size parameter is ignored when given a non empty include list.

    exclude

    a list of values that should be excluded from the result. The result will contain no models.MetaDataBucket associated with one of the keys given in this list.

    index

    the data source index or database name to query.

    returns

    an instance of models.Aggregation with size models.MetaDataBucket representing most occurring entities in the underlying collection.

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