Skip to content

Commit

Permalink
Update codelab.md
Browse files Browse the repository at this point in the history
  • Loading branch information
huichen committed Aug 12, 2013
1 parent dbe6354 commit 22e7052
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/codelab.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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结构体,比如这个结构体返回了关键词出现在文档中的位置,可以用来生成文档的摘要。

## 显示

Expand Down

0 comments on commit 22e7052

Please sign in to comment.