Skip to content

Commit

Permalink
close #2976 (#2977)
Browse files Browse the repository at this point in the history
  • Loading branch information
apavlychev authored Dec 18, 2023
1 parent 67ff0c2 commit 83162ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ object SearchBodyBuilderFn {
builder.endObject()
}

request.trackHits.map(builder.field("track_total_hits", _))
request.trackHits.map(builder.autofield("track_total_hits", _))

if (request.ext.nonEmpty) {
builder.autofield("ext", request.ext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ case class SearchRequest(indexes: Indexes,
seqNoPrimaryTerm: Option[Boolean] = None,
profile: Option[Boolean] = None,
source: Option[String] = None,
trackHits: Option[Boolean] = None,
trackHits: Option[Any] = None,
allowPartialSearchResults: Option[Boolean] = None,
batchedReduceSize: Option[Int] = None,
typedKeys: Option[Boolean] = None,
Expand Down Expand Up @@ -105,6 +105,8 @@ case class SearchRequest(indexes: Indexes,

def trackTotalHits(value: Boolean): SearchRequest = copy(trackHits = Some(value))

def trackTotalHits(value: Long): SearchRequest = copy(trackHits = Some(value))

/** This method introduces zero or more script field definitions into the search construction
*
* @param fields zero or more [[ScriptField]] instances
Expand Down

0 comments on commit 83162ce

Please sign in to comment.