首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >有Go的Lucene包吗?

有Go的Lucene包吗?
EN

Stack Overflow用户
提问于 2012-11-01 03:58:52
回答 3查看 8K关注 0票数 0

鉴于Go的名称相当无害,谷歌搜索这样的包只会给我搜索Go的Lucene包产生一个可识别的结果:this one with no commits

有没有人知道Go的Lucene端口?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-11-01 04:27:42

我认为这个Go SOLR库看起来更有前途。

https://github.com/rtt/Go-Solr/

看起来有点偏瘦,但可能会让你有所收获。

或者,Elasticsearch也有类似的情况:

https://github.com/dustin/go-elasticsearch

票数 6
EN

Stack Overflow用户

发布于 2016-04-21 09:17:54

go还有另一个文本索引库bleve

其功能与lucene非常相似。

索引

代码语言:javascript
运行
复制
message := struct{
    Id   string
    From string
    Body string
}{
    Id:   "example",
    From: "marty.schoch@gmail.com",
    Body: "bleve indexing is easy",
}

mapping := bleve.NewIndexMapping()
index, err := bleve.New("example.bleve", mapping)
if err != nil {
    panic(err)
}
index.Index(message.Id, message)

查询中

代码语言:javascript
运行
复制
index, _ := bleve.Open("example.bleve")
query := bleve.NewQueryStringQuery("bleve")
searchRequest := bleve.NewSearchRequest(query)
searchResult, _ := index.Search(searchRequest)
票数 6
EN

Stack Overflow用户

发布于 2012-11-02 23:32:40

您还可以看看Apache Lucy,它是Lucene的一个“松散的C”端口。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13166549

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档