Interface ElasticSearchDataSetDefBuilder<T extends DataSetDefBuilder>

  • All Superinterfaces:
    DataSetDefBuilder<T>

    public interface ElasticSearchDataSetDefBuilder<T extends DataSetDefBuilder>
    extends DataSetDefBuilder<T>
    A builder for defining ElasticSearch data sets
        DataSetDef dataSetDef = DataSetDefFactory.newElasticSearchDataSetDef()
         .uuid("all_employees")
         .serverURL("localhost:9300")
         .index("index1")
         .type("type1")
         .query("DSL query here")
         .relevance("10")
         .buildDef();
     
    • Method Detail

      • serverURL

        T serverURL​(String serverURL)

        Set the ElasticSearch server instance URL.

        Parameters:
        serverURL - The URL for the ElasticSearch server instance.
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • clusterName

        T clusterName​(String clusterName)

        Set the ElasticSearch cluster name.

        Parameters:
        clusterName - The cluster name.
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • index

        T index​(String index)

        Set the name of the index that this dataset will handle.

        This DataSet definition supports working with multiple indexes, so this method can be invoked several times.

        Parameters:
        index - The index name
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • type

        T type​(String type)

        Set the type of the given index/es that this dataset will handle.

        This DataSet definition supports working with multiple types, so this method can be invoked several times.

        If there is no index configured, the type is skipped.

        Parameters:
        type - The type of the given index/es
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • query

        T query​(String query)

        Set a custom query to extract the data from ElasticSearch server, instead of manually setting index and type parameters.

        This parameter is only used if there are no index and type parameters already configured.

        Parameters:
        query - The DSL query to perform for data extraction.
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • relevance

        T relevance​(String relevance)

        Set the minimum relevance value for resulting search documents.

        If a document relevance value is less than the configured using this method, the document will be present in the dataset.

        Parameters:
        relevance - The minimum relevance value
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.
      • cacheOn

        T cacheOn​(boolean synced,
                  int maxRowsInCache)
        Enables the static cache
        Parameters:
        synced - For keeping the cache synced with the remote database content. If false, the cached content will get never updated once read.
        maxRowsInCache - Max. rows the cache is able to handle. For higher values the cache is automatically disabled.
        Returns:
        The DataSetDefBuilder instance that is being used to configure a DataSetDef.