Record Class CreateIndexRequestWithBM25Similarity

java.lang.Object
java.lang.Record
com.atlassian.confluence.plugins.opensearch.client.CreateIndexRequestWithBM25Similarity
All Implemented Interfaces:
org.opensearch.client.json.JsonpSerializable

public record CreateIndexRequestWithBM25Similarity(org.opensearch.client.opensearch.indices.CreateIndexRequest delegate, CreateIndexRequestWithBM25Similarity.Bm25Settings bm25Settings) extends Record implements org.opensearch.client.json.JsonpSerializable
Decorates CreateIndexRequest with BM25 default similarity settings. It patches the JSON payload, because OpenSearch-java client does not currently support similarity settings. Feature request: https://github.com/opensearch-project/opensearch-java/issues/987 Open PR: https://github.com/opensearch-project/opensearch-java/pull/989/files#
Since:
9.0
  • Field Details

    • ENDPOINT

      public static final org.opensearch.client.transport.Endpoint<CreateIndexRequestWithBM25Similarity,org.opensearch.client.opensearch.indices.CreateIndexResponse,org.opensearch.client.opensearch._types.ErrorResponse> ENDPOINT
  • Constructor Details

    • CreateIndexRequestWithBM25Similarity

      public CreateIndexRequestWithBM25Similarity(org.opensearch.client.opensearch.indices.CreateIndexRequest delegate, CreateIndexRequestWithBM25Similarity.Bm25Settings bm25Settings)
      Creates an instance of a CreateIndexRequestWithBM25Similarity record class.
      Parameters:
      delegate - the value for the delegate record component
      bm25Settings - the value for the bm25Settings record component
  • Method Details

    • of

      public static CreateIndexRequestWithBM25Similarity of(Function<org.opensearch.client.opensearch.indices.CreateIndexRequest.Builder,org.opensearch.client.util.ObjectBuilder<org.opensearch.client.opensearch.indices.CreateIndexRequest>> fn, CreateIndexRequestWithBM25Similarity.Bm25Settings bm25Settings)
    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, org.opensearch.client.json.JsonpMapper mapper)
      Specified by:
      serialize in interface org.opensearch.client.json.JsonpSerializable
    • performRequest

      public org.opensearch.client.opensearch.indices.CreateIndexResponse performRequest(org.opensearch.client.opensearch.OpenSearchClient client) throws IOException
      Throws:
      IOException
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • delegate

      public org.opensearch.client.opensearch.indices.CreateIndexRequest delegate()
      Returns the value of the delegate record component.
      Returns:
      the value of the delegate record component
    • bm25Settings

      Returns the value of the bm25Settings record component.
      Returns:
      the value of the bm25Settings record component