This project has retired. For details please refer to its Attic page.
ElasticSearch Index/Query Starter Template for Bootstrap
Overview
javax.json serialization
javax.xml serialization
MessagePack serialization
Memory EntityStore
File EntityStore
Geode EntityStore
Hazelcast EntityStore
JClouds EntityStore
JDBM EntityStore
LevelDB EntityStore
MongoDB EntityStore
Preferences EntityStore
Redis EntityStore
Riak EntityStore
SQL EntityStore
Ehcache Cache
Memcache Cache
ElasticSearch Index/Query
OpenRDF Index/Query
Apache Solr Index/Query
SQL Index/Query
Codahale Metrics
Migration
Reindexer

ElasticSearch Index/Query

code

docs

tests

Index/Query services backed by ElasticSearch search engine built on top of Apache Lucene.

Warning

ElasticSearch Index/Query do not support ComplexQueries from the Query API, ie. queries by "example value".

Three modes of operation are supported:

In any case, Lucene hard limits apply. See the Lucene File Format documentation about maximum index size and document count. Moreover, each field cannot be larger than 32766 bytes in its serialized form.

Table 65. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.indexing-elasticsearch

0


Embedded on local file system

Filesystem based ElasticSearch Index/Query service relies on the FileConfig Library to decide where it stores its index data, transaction logs etc…

Assembly is done using the provided Assembler:

new ESFilesystemIndexQueryAssembler()
    .withConfig( configModule, configVisibility )
    .assemble( module );
Configuration

Important

By default queries can only traverse Aggregated Associations, if you want to be able to traverse all Associations set the indexNonAggregatedAssociations configuration property to TRUE.

Here are the configuration properties for the filesystem ElasticSearch Index/Query services:

public interface ElasticSearchConfiguration
        extends ConfigurationComposite
{

    /**
     * Cluster name.
     * Defaults to 'polygene_cluster'.
     */
    @Optional Property<String> clusterName();

    /**
     * Index name.
     * Defaults to 'polygene_index'.
     */
    @Optional Property<String> index();

    /**
     * Set to true to index non aggregated associations as if they were aggregated.
     * WARN: Don't use this if your domain model contains circular dependencies.
     * Defaults to 'FALSE'.
     */
    @UseDefaults Property<Boolean> indexNonAggregatedAssociations();

}

All configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without configuration.

In an ElasticSearch cluster

Assembly

Assembly is done using the provided Assembler:

new ESClusterIndexQueryAssembler()
    .withConfig( configModule, configVisibility )
    .assemble( module );
Configuration

Here are the configuration properties for the clustered ElasticSearch Index/Query service. Note that it inherits the properties defined in the filesystem configuration, see above.

public interface ElasticSearchClusterConfiguration
        extends ElasticSearchConfiguration
{

    /**
     * Coma separated list of nodes host:port.
     * Defaults to '127.0.0.1:9300'.
     */
    @Optional Property<String> nodes();

    /**
     * Allows client to sniff the rest of the cluster, and add those into its list of machines to use.
     * In this case, note that the ip addresses used will be the ones that the other nodes were started
     * with (the “publish” address).
     * Defaults to FALSE.
     */
    @UseDefaults Property<Boolean> clusterSniff();

    /**
     * Set to true to ignore cluster name validation of connected nodes.
     * Defaults to FALSE.
     */
    @UseDefaults Property<Boolean> ignoreClusterName();

    /**
     * The time to wait for a ping response from a node.
     * Defaults to 5s.
     */
    @Optional Property<String> pingTimeout();

    /**
     * How often to sample / ping the nodes listed and connected.
     * Defaults to 5s.
     */
    @Optional Property<String> samplerInterval();

}

Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without configuration.

Using a provided client

Assembly

Assembly is done using the provided Assembler:

new ESClientIndexQueryAssembler( client )
    .withConfig( configModule, configVisibility )
    .assemble( module );
Configuration

Here are the configuration properties for the ElasticSearch Index/Query service using a provided client. Note that the clusterName is ignored as this is managed by the client.

public interface ElasticSearchConfiguration
        extends ConfigurationComposite
{

    /**
     * Cluster name.
     * Defaults to 'polygene_cluster'.
     */
    @Optional Property<String> clusterName();

    /**
     * Index name.
     * Defaults to 'polygene_index'.
     */
    @Optional Property<String> index();

    /**
     * Set to true to index non aggregated associations as if they were aggregated.
     * WARN: Don't use this if your domain model contains circular dependencies.
     * Defaults to 'FALSE'.
     */
    @UseDefaults Property<Boolean> indexNonAggregatedAssociations();

}

Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without configuration.