This project has retired. For details please refer to its Attic page.
ElasticSearch Index/Query
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

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

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

Traceback (most recent call last):
  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 100, in <module>
    for line in snippet(**configuration(indata)):
  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 51, in snippet
    sourceFile = open(PATH_PATTERN % locals())
IOError: [Errno 2] No such file or directory: 'extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchConfiguration.java'

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 ElasticSearchIndexingConfiguration
{

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

Traceback (most recent call last):
  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 100, in <module>
    for line in snippet(**configuration(indata)):
  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 51, in snippet
    sourceFile = open(PATH_PATTERN % locals())
IOError: [Errno 2] No such file or directory: 'extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchConfiguration.java'

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