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:
parent
ae528d8321
commit
8ce10fb6e1
2 changed files with 42 additions and 15 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue