diff --git a/docs/codelab.md b/docs/codelab.md index 4aba979..ab79fd0 100644 --- a/docs/codelab.md +++ b/docs/codelab.md @@ -86,7 +86,7 @@ searcher.Init(types.EngineInitOptions{ ```go searcher.IndexDocument(docId, types.DocumentIndexData{ - Content: weibo.Text, // Weibo结构体见上文的定义 + Content: weibo.Text, // Weibo结构体见上文的定义。必须是UTF-8格式。 Fields: WeiboScoringFields{ Timestamp: weibo.Timestamp, RepostsCount: weibo.RepostsCount, @@ -167,7 +167,7 @@ response := searcher.Search(types.SearchRequest{ }) ``` -其中,Text是输入的搜索短语,RankOptions定义了排序选项。WeiboScoringCriteria就是我们在上面定义的评分规则。另外你也可以通过OutputOffset和MaxOutputs参数控制分页输出。搜索结果保存在response变量中,具体内容见[types/search_response.go](/types/search_response.go)文件中定义的SearchResponse结构体,比如这个结构体返回了关键词出现在文档中的位置,可以用来生成文档的摘要。 +其中,Text是输入的搜索短语(必须是UTF-8格式),RankOptions定义了排序选项。WeiboScoringCriteria就是我们在上面定义的评分规则。另外你也可以通过OutputOffset和MaxOutputs参数控制分页输出。搜索结果保存在response变量中,具体内容见[types/search_response.go](/types/search_response.go)文件中定义的SearchResponse结构体,比如这个结构体返回了关键词出现在文档中的位置,可以用来生成文档的摘要。 ## 显示