• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






张伯雨

学习使人快乐
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页

2017年9月1日

search_response.go
摘要: package typesimport ( "github.com/huichen/wukong/utils")type SearchResponse struct { // 搜索用到的关键词 Tokens []string // 搜索到的文档,已排序 Docs []ScoredDocument // 搜索是否超时。超时的情况下也可能会返回部分结果 Tim... 阅读全文
posted @ 2017-09-01 09:30 张伯雨 阅读(412) 评论(0) 推荐(0)
 
scoring_criteria.go
摘要: package types// 评分规则通用接口type ScoringCriteria interface { // 给一个文档评分,文档排序时先用第一个分值比较,如果 // 分值相同则转移到第二个分值,以此类推。 // 返回空切片表明该文档应该从最终排序结果中剔除。 Score(doc IndexedDocument, fields interface{}) []flo... 阅读全文
posted @ 2017-09-01 09:29 张伯雨 阅读(160) 评论(0) 推荐(0)
 
engine_init_options.go
摘要: package typesimport ( "log" "runtime")var ( // EngineInitOptions的默认值 defaultNumSegmenterThreads = runtime.NumCPU() defaultNumShards = 2 defaultIndexerBufferLeng... 阅读全文
posted @ 2017-09-01 09:28 张伯雨 阅读(442) 评论(0) 推荐(0)
 
index.go
摘要: package typestype DocumentIndex struct { // 文本的DocId DocId uint64 // 文本的关键词长 TokenLength float32 // 加入的索引键 Keywords []KeywordIndex}// 反向索引项,这实际上标注了一个(搜索键,文档)对。type KeywordIndex struc... 阅读全文
posted @ 2017-09-01 09:28 张伯雨 阅读(252) 评论(0) 推荐(0)
 
index_init_oprions.go
摘要: package types// 这些常数定义了反向索引表存储的数据类型const ( // 仅存储文档的docId DocIdsIndex = 0 // 存储关键词的词频,用于计算BM25 FrequenciesIndex = 1 // 存储关键词在文档中出现的具体字节位置(可能有多个) // 如果你希望得到关键词紧邻度数据,必须使用LocationsIndex... 阅读全文
posted @ 2017-09-01 09:28 张伯雨 阅读(138) 评论(0) 推荐(0)
 
document_index_data.go
摘要: package typestype DocumentIndexData struct { // 文档全文(必须是UTF-8格式),用于生成待索引的关键词 Content string // 文档的关键词 // 当Content不为空的时候,优先从Content中分词得到关键词。 // Tokens存在的意义在于绕过悟空内置的分词器,在引擎外部 // 进行分词和预... 阅读全文
posted @ 2017-09-01 09:27 张伯雨 阅读(175) 评论(0) 推荐(0)
 
wukong.go
摘要: package wukongimport ( _ "github.com/boltdb/bolt" _ "github.com/cznic/kv" _ "github.com/huichen/murmur" _ "github.com/huichen/sego") 阅读全文
posted @ 2017-09-01 09:26 张伯雨 阅读(193) 评论(0) 推荐(0)
 
util.go
摘要: package utils//int数字比较func AbsInt(a int) int { if a < 0 { return -a } return a}func MinInt(a, b int) int { if a < b { return a } return b} 阅读全文
posted @ 2017-09-01 09:26 张伯雨 阅读(165) 评论(0) 推荐(0)
 
volume_manager.go
摘要: package managerimport ( "net/http" "github.com/030io/whalefs/manager/volume" "os" "io/ioutil" "strings" "strconv" "fmt" "time" "github.com/030io/whalefs/master/api" "gith... 阅读全文
posted @ 2017-09-01 09:25 张伯雨 阅读(258) 评论(0) 推荐(0)
 
admin-handlers.go
摘要: package managerimport ( "net/http" "regexp" "strconv" "io" "fmt" "github.com/030io/whalefs/manager/volume" "gopkg.in/redis.v2" "os")var ( postVolumeUrl *regexp.Regexp //提交卷... 阅读全文
posted @ 2017-09-01 09:24 张伯雨 阅读(173) 评论(0) 推荐(0)
 
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页