Class GetSourceRequest

java.lang.Object
org.elasticsearch.client.core.GetSourceRequest
All Implemented Interfaces:
Validatable

public final class GetSourceRequest
extends java.lang.Object
implements Validatable
  • Field Summary

    Fields inherited from interface org.elasticsearch.client.Validatable

    EMPTY
  • Constructor Summary

    Constructors
    Constructor Description
    GetSourceRequest​(java.lang.String index, java.lang.String id)  
  • Method Summary

    Modifier and Type Method Description
    org.elasticsearch.search.fetch.subphase.FetchSourceContext fetchSourceContext()  
    GetSourceRequest fetchSourceContext​(org.elasticsearch.search.fetch.subphase.FetchSourceContext context)
    Allows setting the FetchSourceContext for this request, controlling if and how _source should be returned.
    static GetSourceRequest from​(org.elasticsearch.action.get.GetRequest getRequest)  
    java.lang.String id()  
    java.lang.String index()  
    java.lang.String preference()  
    GetSourceRequest preference​(java.lang.String preference)
    Sets the preference to execute the search.
    boolean realtime()  
    GetSourceRequest realtime​(boolean realtime)  
    boolean refresh()  
    GetSourceRequest refresh​(boolean refresh)
    Should a refresh be executed before this get operation causing the operation to return the latest value.
    java.lang.String routing()  
    GetSourceRequest routing​(java.lang.String routing)
    Controls the shard routing of the request.
    java.lang.String type()  
    GetSourceRequest type​(java.lang.String type)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.client.Validatable

    validate
  • Constructor Details

    • GetSourceRequest

      public GetSourceRequest​(java.lang.String index, java.lang.String id)
  • Method Details

    • from

      public static GetSourceRequest from​(org.elasticsearch.action.get.GetRequest getRequest)
    • routing

      public GetSourceRequest routing​(java.lang.String routing)
      Controls the shard routing of the request. Using this value to hash the shard and not the id.
    • preference

      public GetSourceRequest preference​(java.lang.String preference)
      Sets the preference to execute the search. Defaults to randomize across shards. Can be set to _local to prefer local shards or a custom value, which guarantees that the same order will be used across different requests.
    • refresh

      public GetSourceRequest refresh​(boolean refresh)
      Should a refresh be executed before this get operation causing the operation to return the latest value. Note, heavy get should not set this to true. Defaults to false.
    • realtime

      public GetSourceRequest realtime​(boolean realtime)
    • fetchSourceContext

      public GetSourceRequest fetchSourceContext​(org.elasticsearch.search.fetch.subphase.FetchSourceContext context)
      Allows setting the FetchSourceContext for this request, controlling if and how _source should be returned. Note, the fetchSource field of the context must be set to true.
    • index

      public java.lang.String index()
    • type

      public java.lang.String type()
    • type

      public GetSourceRequest type​(java.lang.String type)
    • id

      public java.lang.String id()
    • routing

      public java.lang.String routing()
    • preference

      public java.lang.String preference()
    • refresh

      public boolean refresh()
    • realtime

      public boolean realtime()
    • fetchSourceContext

      public org.elasticsearch.search.fetch.subphase.FetchSourceContext fetchSourceContext()