Skip to content

Commit

Permalink
update dictionary example code [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vcaesar committed Dec 1, 2018
1 parent 0155d08 commit f39fcc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions examples/dict/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
16 changes: 8 additions & 8 deletions examples/dict2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit f39fcc1

Please sign in to comment.