Skip to content

Commit

Permalink
Implement changes in Disjunction max query
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjaftn committed Nov 15, 2023
1 parent 51eefde commit 98c8137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/overview/queries/elastic_query_disjunction_max.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import zio.elasticsearch.ElasticQuery.disjunctionMax

You can create a `Disjunction max` query using the `disjunctionMax` method this way:
```scala
val query: DisjunctionMaxQuery = disjunctionMax(term(field = "stringField", value = "test"), exists(field = "intField"))
val query: DisjunctionMaxQuery = disjunctionMax(query = term(field = "stringField", value = "test"), queries = exists(field = "intField"), term(field = "termField", value = "test"))
```

If you want to change the `tieBreaker`, you can use `tieBreaker` method:
```scala
val queryWithTieBreaker: DisjunctionMaxQuery = disjunctionMax(exists(field = "existsField"), ids(values = "1", "2", "3")).tieBreaker(0.5f)
val queryWithTieBreaker: DisjunctionMaxQuery = disjunctionMax(query = exists(field = "existsField"), queries = ids(values = "1", "2", "3"), term(field = "termField", value = "test")).tieBreaker(0.5f)
```

You can find more information about `Disjunction max` query [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-dis-max-query.html).

0 comments on commit 98c8137

Please sign in to comment.