From 4b77e11e58a3f037faf5c8e494da67822e1f597b Mon Sep 17 00:00:00 2001 From: Andrew Valencik Date: Thu, 16 May 2024 17:37:35 -0400 Subject: [PATCH] Add section on printing boosts with precision --- docs/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/index.md b/docs/index.md index 906fd10..f04fd65 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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