From 85db80035af2c17cad02da9ccfc54dddd9693023 Mon Sep 17 00:00:00 2001 From: Likith B <62029862+Likith101@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:38:16 +0530 Subject: [PATCH] MB-61640: Fuzzy Dynamic Scoring (#254) Co-authored-by: Abhinav Dangeti --- dict.go | 3 +++ go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dict.go b/dict.go index d06278fd..7c52ae99 100644 --- a/dict.go +++ b/dict.go @@ -165,6 +165,9 @@ func (i *DictionaryIterator) Next() (*index.DictEntry, error) { return nil, nil } term, postingsOffset := i.itr.Current() + if fitr, ok := i.itr.(vellum.FuzzyIterator); ok { + i.entry.EditDistance = fitr.EditDistance() + } i.entry.Term = string(term) if !i.omitCount { i.err = i.tmp.read(postingsOffset, i.d) diff --git a/go.mod b/go.mod index f70c2ac0..13b2e2e9 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,11 @@ go 1.21 require ( github.com/RoaringBitmap/roaring v1.9.3 - github.com/blevesearch/bleve_index_api v1.1.12 + github.com/blevesearch/bleve_index_api v1.1.13 github.com/blevesearch/go-faiss v1.0.23 github.com/blevesearch/mmap-go v1.0.4 github.com/blevesearch/scorch_segment_api/v2 v2.2.16 - github.com/blevesearch/vellum v1.0.10 + github.com/blevesearch/vellum v1.0.11 github.com/golang/snappy v0.0.1 github.com/spf13/cobra v1.7.0 ) diff --git a/go.sum b/go.sum index 410b4cf4..d15a1d18 100644 --- a/go.sum +++ b/go.sum @@ -2,16 +2,16 @@ github.com/RoaringBitmap/roaring v1.9.3 h1:t4EbC5qQwnisr5PrP9nt0IRhRTb9gMUgQF4t4 github.com/RoaringBitmap/roaring v1.9.3/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/blevesearch/bleve_index_api v1.1.12 h1:P4bw9/G/5rulOF7SJ9l4FsDoo7UFJ+5kexNy1RXfegY= -github.com/blevesearch/bleve_index_api v1.1.12/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= +github.com/blevesearch/bleve_index_api v1.1.13 h1:+nrA6oRJr85aCPyqaeZtsruObwKojutfonHJin/BP48= +github.com/blevesearch/bleve_index_api v1.1.13/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= github.com/blevesearch/go-faiss v1.0.23 h1:Wmc5AFwDLKGl2L6mjLX1Da3vCL0EKa2uHHSorcIS1Uc= github.com/blevesearch/go-faiss v1.0.23/go.mod h1:OMGQwOaRRYxrmeNdMrXJPvVx8gBnvE5RYrr0BahNnkk= github.com/blevesearch/mmap-go v1.0.4 h1:OVhDhT5B/M1HNPpYPBKIEJaD0F3Si+CrEKULGCDPWmc= github.com/blevesearch/mmap-go v1.0.4/go.mod h1:EWmEAOmdAS9z/pi/+Toxu99DnsbhG1TIxUoRmJw/pSs= github.com/blevesearch/scorch_segment_api/v2 v2.2.16 h1:uGvKVvG7zvSxCwcm4/ehBa9cCEuZVE+/zvrSl57QUVY= github.com/blevesearch/scorch_segment_api/v2 v2.2.16/go.mod h1:VF5oHVbIFTu+znY1v30GjSpT5+9YFs9dV2hjvuh34F0= -github.com/blevesearch/vellum v1.0.10 h1:HGPJDT2bTva12hrHepVT3rOyIKFFF4t7Gf6yMxyMIPI= -github.com/blevesearch/vellum v1.0.10/go.mod h1:ul1oT0FhSMDIExNjIxHqJoGpVrBpKCdgDQNxfqgJt7k= +github.com/blevesearch/vellum v1.0.11 h1:SJI97toEFTtA9WsDZxkyGTaBWFdWl1n2LEDCXLCq/AU= +github.com/blevesearch/vellum v1.0.11/go.mod h1:QgwWryE8ThtNPxtgWJof5ndPfx0/YMBh+W2weHKPw8Y= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=