diff --git a/examples/dict/main.go b/examples/dict/main.go index bc47d85..dbd86b9 100644 --- a/examples/dict/main.go +++ b/examples/dict/main.go @@ -26,9 +26,9 @@ func dictZh() { defer searcher.Close() // 将文档加入索引,docId 从1开始 - searcher.Index(1, text) - searcher.Index(2, text1) - searcher.Index(3, text2) + searcher.Index("1", text) + searcher.Index("2", text1) + searcher.Index("3", text2) // 等待索引刷新完毕 searcher.Flush() @@ -51,9 +51,9 @@ func dictJp() { text3 := "こんにちは世界" // 将文档加入索引,docId 从1开始 - searcher2.Index(1, text) - searcher2.Index(2, text1) - searcher2.Index(3, types.DocData{Content: text3}) + searcher2.Index("1", text) + searcher2.Index("2", text1) + searcher2.Index("3", types.DocData{Content: text3}) // 等待索引刷新完毕 searcher2.Flush() diff --git a/examples/dict2/main.go b/examples/dict2/main.go index 6e5aa32..92e6b96 100644 --- a/examples/dict2/main.go +++ b/examples/dict2/main.go @@ -29,10 +29,10 @@ func searchWithGseFn1(seg gse.Segmenter) { log.Println("searcher----------------...") - searcher.Index(1, data) - searcher.Index(2, data1) - searcher.Index(4, data1) - searcher.Index(3, data2) + searcher.Index("1", data) + searcher.Index("2", data1) + searcher.Index("4", data1) + searcher.Index("3", data2) searcher.Flush() search := searcher.Search(req) @@ -45,10 +45,10 @@ func searchWithGse2(seg gse.Segmenter) { Using: 1, }) - searcher1.Index(1, data) - searcher1.Index(2, data1) - searcher1.Index(4, data1) - searcher1.Index(3, data2) + searcher1.Index("1", data) + searcher1.Index("2", data1) + searcher1.Index("4", data1) + searcher1.Index("3", data2) searcher1.Flush() search1 := searcher1.Search(req)