Skip to content

Commit

Permalink
Use compile for team
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Jun 10, 2024
1 parent 1ebb89e commit 22463cd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions modules/core/src/main/scala/team.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ object TeamQuery:
.start(from.value)
.size(size.value)

def countDef(query: Team) = search(index).query(makeQuery(query)) size 0
def countDef(query: Team) = search(index).query(makeQuery(query)).size(0)

private def parsed(query: Team) = QueryParser(query.text, Nil)

private def makeQuery(team: Team) = must {
parsed(team).terms.map(term => multiMatchQuery(term).fields(searchableFields*))
}
private def makeQuery(team: Team) =
QueryParser(team.text, Nil).terms.map(term => multiMatchQuery(term).fields(searchableFields*)).compile

private val searchableFields = List(Fields.name, Fields.description)

0 comments on commit 22463cd

Please sign in to comment.