java.lang.Object
org.elasticsearch.protocol.xpack.graph.Hop
- All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentFragment
A Hop represents one of potentially many stages in a graph exploration.
Each Hop identifies one or more fields in which it will attempt to find
terms that are significantly connected to the previous Hop. Each field is identified
using a
VertexRequest
An example series of Hops on webserver logs would be:
- an initial Hop to find the top ten IPAddresses trying to access urls containing the word "admin"
- a secondary Hop to see which other URLs those IPAddresses were trying to access
Optionally, each hop can contain a "guiding query" that further limits the set of documents considered. In our weblog example above we might choose to constrain the second hop to only look at log records that had a response code of 404.
If absent, the list of VertexRequests is inherited from the prior Hop's list to avoid repeating
the fields that will be examined at each stage.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddVertexRequest(String fieldName) Add a field in which thisHopwill look for terms that are highly linked to previous hops and optionally the guiding query.protected List<VertexRequest> intgetVertexRequest(int requestNumber) voidguidingQuery(QueryBuilder queryBuilder) An optional parameter that focuses the exploration on documents that match the given query.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) validate(ActionRequestValidationException validationException) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
Hop
-
-
Method Details
-
validate
public ActionRequestValidationException validate(ActionRequestValidationException validationException) -
getParentHop
-
guidingQuery
-
addVertexRequest
Add a field in which thisHopwill look for terms that are highly linked to previous hops and optionally the guiding query.- Parameters:
fieldName- a field in the chosen index
-
guidingQuery
An optional parameter that focuses the exploration on documents that match the given query.- Parameters:
queryBuilder- any query
-
getEffectiveVertexRequests
-
getNumberVertexRequests
public int getNumberVertexRequests() -
getVertexRequest
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-