Class GraphExploreRequestBuilder

java.lang.Object
org.elasticsearch.action.ActionRequestBuilder<GraphExploreRequest,GraphExploreResponse>
org.elasticsearch.xpack.core.graph.action.GraphExploreRequestBuilder
All Implemented Interfaces:
RequestBuilder<GraphExploreRequest,GraphExploreResponse>

public class GraphExploreRequestBuilder extends ActionRequestBuilder<GraphExploreRequest,GraphExploreResponse>
See Also:
  • Constructor Details

  • Method Details

    • setIndices

      public GraphExploreRequestBuilder setIndices(String... indices)
    • setIndicesOptions

      public GraphExploreRequestBuilder setIndicesOptions(IndicesOptions options)
      Specifies what type of requested indices to ignore and wildcard indices expressions.

      For example indices that don't exist.

    • setRouting

      public GraphExploreRequestBuilder setRouting(String routing)
      A comma separated list of routing values to control the shards the action will be executed on.
    • setRouting

      public GraphExploreRequestBuilder setRouting(String... routing)
      The routing values to control the shards that the action will be executed on.
    • sampleDiversityField

      public GraphExploreRequestBuilder sampleDiversityField(String fieldName)
      Optional choice of single-value field on which to diversify sampled search results
    • sampleDiversityField

      public String sampleDiversityField()
    • maxDocsPerDiversityValue

      public GraphExploreRequestBuilder maxDocsPerDiversityValue(int max)
      Optional number of permitted docs with same value in sampled search results. Must also declare which field using sampleDiversityField
    • maxDocsPerDiversityValue

      public int maxDocsPerDiversityValue()
    • setTimeout

      public GraphExploreRequestBuilder setTimeout(org.elasticsearch.core.TimeValue timeout)
      An optional timeout to control how long the graph exploration is allowed to take.
    • createNextHop

      public Hop createNextHop(@Nullable QueryBuilder guidingQuery)
      Add a stage in the graph exploration. Each hop represents a stage of querying elasticsearch to identify terms which can then be connnected to other terms in a subsequent hop.
      Parameters:
      guidingQuery - optional choice of query which influences which documents are considered in this stage
      Returns:
      a Hop object that holds settings for a stage in the graph exploration
    • useSignificance

      public GraphExploreRequestBuilder useSignificance(boolean value)
      Controls the choice of algorithm used to select interesting terms. The default value is true which means terms are selected based on significance (see the SignificantTerms aggregation) rather than popularity (using the TermsAggregator).
      Parameters:
      value - true if the significant_terms algorithm should be used.
    • sampleSize

      public GraphExploreRequestBuilder sampleSize(int maxNumberOfDocsPerHop)
      The number of top-matching documents that are considered during each hop (default is SamplerAggregationBuilder.DEFAULT_SHARD_SAMPLE_SIZE Very small values (less than 50) may not provide sufficient weight-of-evidence to identify significant connections between terms.

      Very large values (many thousands) are not recommended with loosely defined queries (fuzzy queries or those with many OR clauses). This is because any useful signals in the best documents are diluted with irrelevant noise from low-quality matches. Performance is also typically better with smaller samples as there are less look-ups required for background frequencies of terms found in the documents

      Parameters:
      maxNumberOfDocsPerHop - the shard-level sample size in documents