Skip to content

Commit

Permalink
Add section on printing boosts with precision
Browse files Browse the repository at this point in the history
  • Loading branch information
valencik committed May 16, 2024
1 parent e7de3c2 commit 4b77e11
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ import pink.cozydev.lucille.QueryPrinter
QueryPrinter.print(Query.And(Query.Term("cats"), Query.Term("dogs")))
```

Because the numeric value of a query boost parameter is modelled as a `Float`, the query printer
has a `precision` parameter it uses to round the boost parameter for pretty printing:

```scala mdoc
val queryWithBoost = Query.Boost(Query.Phrase("apple pi"), 3.14159265f)

// the default precision is 2
QueryPrinter.print(queryWithBoost)

QueryPrinter.print(queryWithBoost, precision=5)
```

### Last Query Rewriting

To enable a better interactive search experience, it can be helpful to rewrite the last term as a
Expand Down

0 comments on commit 4b77e11

Please sign in to comment.