Skip to content

Commit

Permalink
Set fetchSource=false when query
Browse files Browse the repository at this point in the history
This potentially fix queries with initial clocks
  • Loading branch information
lenguyenthanh committed Jun 2, 2024
1 parent bf1a34b commit 7806225
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/core/src/main/scala/forum.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ object ForumQuery {
index =>
search(index.name)
.query(makeQuery(query))
.fetchSource(false)
.sortBy(
fieldSort(Fields.date).order(SortOrder.DESC)
)
Expand Down
5 changes: 2 additions & 3 deletions modules/core/src/main/scala/game.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ object GameQuery {
def searchDef(query: Game)(from: From, size: Size) =
index =>
(search(index.name)
.query(
makeQuery(query)
)
.query(makeQuery(query))
.fetchSource(false)
.sortBy(query.sorting.definition)
.start(from.value) size size.value).timeout(timeout)

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/main/scala/study.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ object StudyQuery {
index =>
search(index.name)
.query(makeQuery(query))
.fetchSource(false)
.sortBy(
fieldSort("_score").order(SortOrder.DESC),
fieldSort(Fields.likes).order(SortOrder.DESC)
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/main/scala/team.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ object TeamQuery {
index =>
search(index.name)
.query(makeQuery(query))
.fetchSource(false)
.sortBy(
fieldSort(Fields.nbMembers).order(SortOrder.DESC)
)
Expand Down

0 comments on commit 7806225

Please sign in to comment.