0
0
Fork 0

fix incorrect prefix search behavior

avoids double incrementing of end term when reading term dict
fixes #293
This commit is contained in:
Marty Schoch 2015-12-04 14:07:16 -05:00
parent 699c86073a
commit a73a178923
2 changed files with 20 additions and 1 deletions

View File

@ -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) {

View File

@ -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"
}
]
}
}
]