fix incorrect prefix search behavior
avoids double incrementing of end term when reading term dict fixes #293
This commit is contained in:
parent
699c86073a
commit
a73a178923
|
@ -42,7 +42,7 @@ func (i *IndexReader) FieldDictRange(fieldName string, startTerm []byte, endTerm
|
|||
}
|
||||
|
||||
func (i *IndexReader) FieldDictPrefix(fieldName string, termPrefix []byte) (index.FieldDict, error) {
|
||||
return i.FieldDictRange(fieldName, termPrefix, incrementBytes(termPrefix))
|
||||
return i.FieldDictRange(fieldName, termPrefix, termPrefix)
|
||||
}
|
||||
|
||||
func (i *IndexReader) DocIDReader(start, end string) (index.DocIDReader, error) {
|
||||
|
|
|
@ -477,5 +477,24 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "reproduce bug in prefix search",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"field": "title",
|
||||
"prefix": "miss"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue