Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix QueryPhaseResultConsumer incomplete callback loops ([#19231](https://github.com/opensearch-project/OpenSearch/pull/19231))
- Fix the `scaled_float` precision issue ([#19188](https://github.com/opensearch-project/OpenSearch/pull/19188))
- Fix Using an excessively large reindex slice can lead to a JVM OutOfMemoryError on coordinator.([#18964](https://github.com/opensearch-project/OpenSearch/pull/18964))
- Serialize routing field in TermVectorsRequest in the REST client ([#19195](https://github.com/opensearch-project/OpenSearch/pull/19195))

### Dependencies
- Bump `com.netflix.nebula.ospackage-base` from 12.0.0 to 12.1.0 ([#19019](https://github.com/opensearch-project/OpenSearch/pull/19019))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
if (requestFieldStatistics == false) builder.field("field_statistics", false);
if (requestTermStatistics) builder.field("term_statistics", true);
if (perFieldAnalyzer != null) builder.field("per_field_analyzer", perFieldAnalyzer);
if (routing != null) builder.field("routing", routing);

if (docBuilder != null) {
BytesReference doc = BytesReference.bytes(docBuilder);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.client.core;

import org.opensearch.client.AbstractRequestTestCase;
import org.opensearch.core.xcontent.XContentParser;

import java.io.IOException;

public class TermVectorsRequestTests extends AbstractRequestTestCase<
TermVectorsRequest,
org.opensearch.action.termvectors.TermVectorsRequest> {
@Override
protected TermVectorsRequest createClientTestInstance() {
TermVectorsRequest clientRequest = new TermVectorsRequest(randomAlphaOfLength(5), randomAlphaOfLength(5));
clientRequest.setRouting("some-routing");
return clientRequest;
}

@Override
protected org.opensearch.action.termvectors.TermVectorsRequest doParseToServerInstance(XContentParser parser) throws IOException {
org.opensearch.action.termvectors.TermVectorsRequest serverRequest = new org.opensearch.action.termvectors.TermVectorsRequest();
org.opensearch.action.termvectors.TermVectorsRequest.parseRequest(serverRequest, parser);
return serverRequest;
}

@Override
protected void assertInstances(
org.opensearch.action.termvectors.TermVectorsRequest serverInstance,
TermVectorsRequest clientTestInstance
) {
assertEquals(serverInstance.routing(), clientTestInstance.getRouting());
}
}
Loading