From dca8d4c2f224eddd40089c6f5c193df15902207c Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 18 May 2022 14:10:06 -0700 Subject: [PATCH] Added note about BigDecimals - closes #1538 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 8875114..a4854f1 100644 --- a/README.md +++ b/README.md @@ -2063,6 +2063,18 @@ Product.search("api", misspellings: {prefix_length: 2}) # api, apt, no ahi Product.search("ah", misspellings: {prefix_length: 2}) # ah, no aha ``` +BigDecimal values are indexed as floats by default so they can be used for boosting. Convert them to strings to keep full precision. + +```ruby +class Product < ApplicationRecord + def search_data + { + units: units.to_s("F") + } + end +end +``` + ## Gotchas ### Consistency -- libgit2 0.21.0