Skip to content

Commit

Permalink
Decorator + import housekeeping
Browse files Browse the repository at this point in the history
Signed-off-by: Finn Carroll <[email protected]>
  • Loading branch information
finnegancarroll committed Aug 22, 2024
1 parent b4e61b8 commit cd5f05f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions server/src/main/java/org/opensearch/search/SearchHit.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.opensearch.Version;
import org.opensearch.action.OriginalIndices;
import org.opensearch.common.Nullable;
import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.document.DocumentField;
import org.opensearch.common.xcontent.XContentHelper;
Expand Down Expand Up @@ -236,6 +237,11 @@ public SearchHit(StreamInput in) throws IOException {
this(new SearchHitSerDe().deserialize(in));
}

/**
* Internal access for serialization interface.
* @opensearch.api
*/
@ExperimentalApi
public interface SerializationAccess {
float getScore();
Text getId();
Expand Down
6 changes: 6 additions & 0 deletions server/src/main/java/org/opensearch/search/SearchHits.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.search.TotalHits.Relation;
import org.opensearch.common.Nullable;
import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.annotation.PublicApi;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.core.common.io.stream.StreamInput;
Expand Down Expand Up @@ -104,6 +105,11 @@ public SearchHits(
this.collapseValues = collapseValues;
}

/**
* Internal access for serialization interface.
* @opensearch.api
*/
@ExperimentalApi
public interface SerializationAccess {
TotalHits getTotalHits();
float getMaxScore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

package org.opensearch.search.fetch;

import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -69,6 +70,11 @@ public FetchSearchResult(ShardSearchContextId id, SearchShardTarget shardTarget)
setSearchShardTarget(shardTarget);
}

/**
* Internal access for serialization interface.
* @opensearch.api
*/
@ExperimentalApi
public interface SerializationAccess {
ShardSearchContextId getShardSearchContextId();
SearchHits getHits();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
import java.util.Map;
import java.util.stream.Collectors;

import static java.util.Collections.*;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
import static java.util.Collections.unmodifiableMap;
import static org.opensearch.common.lucene.Lucene.readExplanation;
import static org.opensearch.common.lucene.Lucene.writeExplanation;
import static org.opensearch.search.SearchHit.SINGLE_MAPPING_TYPE;
Expand Down

0 comments on commit cd5f05f

Please sign in to comment.