Fix bug on elastic search (#12811)

* Fix bug on elastic search

* Add more comments for elastic search result startIndex and endIndex

* refactor indexPos

* refactor indexPos

* Fix bug
This commit is contained in:
Lunny Xiao authored and GitHub committed 2020-09-12 20:31:52 +08:00
1 parent ae528d8321
commit 8ce10fb6e1
2 files changed
+42 -15

No files matched your search

@@ -34,3 +34,9 @@ func TestESIndexAndSearch(t *testing.T) {
testIndexer("elastic_search", t, indexer)
}
func TestIndexPos(t *testing.T) {
startIdx, endIdx := indexPos("test index start and end", "start", "end")
assert.EqualValues(t, 11, startIdx)
assert.EqualValues(t, 24, endIdx)
}