Module org.elasticsearch.xcore
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>
Creates a new
GraphExploreRequestBuilder- See Also:
-
Field Summary
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNextHop(QueryBuilder guidingQuery) Add a stage in the graph exploration.intmaxDocsPerDiversityValue(int max) Optional number of permitted docs with same value in sampled search results.sampleDiversityField(String fieldName) Optional choice of single-value field on which to diversify sampled search resultssampleSize(int maxNumberOfDocsPerHop) The number of top-matching documents that are considered during each hop (default isSamplerAggregationBuilder.DEFAULT_SHARD_SAMPLE_SIZEVery small values (less than 50) may not provide sufficient weight-of-evidence to identify significant connections between terms.setIndices(String... indices) setIndicesOptions(IndicesOptions options) Specifies what type of requested indices to ignore and wildcard indices expressions.setRouting(String routing) A comma separated list of routing values to control the shards the action will be executed on.setRouting(String... routing) The routing values to control the shards that the action will be executed on.setTimeout(org.elasticsearch.core.TimeValue timeout) An optional timeout to control how long the graph exploration is allowed to take.useSignificance(boolean value) Controls the choice of algorithm used to select interesting terms.
-
Constructor Details
-
GraphExploreRequestBuilder
-
-
Method Details
-
setIndices
-
setIndicesOptions
Specifies what type of requested indices to ignore and wildcard indices expressions.For example indices that don't exist.
-
setRouting
A comma separated list of routing values to control the shards the action will be executed on. -
setRouting
The routing values to control the shards that the action will be executed on. -
sampleDiversityField
Optional choice of single-value field on which to diversify sampled search results -
sampleDiversityField
-
maxDocsPerDiversityValue
Optional number of permitted docs with same value in sampled search results. Must also declare which field using sampleDiversityField -
maxDocsPerDiversityValue
public int maxDocsPerDiversityValue() -
setTimeout
An optional timeout to control how long the graph exploration is allowed to take. -
createNextHop
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
Hopobject that holds settings for a stage in the graph exploration
-
useSignificance
Controls the choice of algorithm used to select interesting terms. The default value is true which means terms are selected based on significance (see theSignificantTermsaggregation) rather than popularity (using theTermsAggregator).- Parameters:
value- true if the significant_terms algorithm should be used.
-
sampleSize
The number of top-matching documents that are considered during each hop (default isSamplerAggregationBuilder.DEFAULT_SHARD_SAMPLE_SIZEVery 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
-