dtp19819
dtp19819
2012-10-31 19:58

Go是否有Lucene软件包?

已采纳

Given the rather innocuous naming of Go, Google searching for such a package only produces one discernable result for my searches for a Lucene package for Go: this one with no commits.

Does anyone know of any Lucene port for Go?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • dougutuo9879 dougutuo9879 9年前

    This Go SOLR library looks rather more promising, I think.

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

    Looks a bit on the lean side, but might get you somewhere.

    Or, similar story for this with Elasticsearch:

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

    点赞 评论 复制链接分享
  • duanhuantong8278 duanhuantong8278 5年前

    There is another text indexing library for go, bleve

    The features are very similar to lucene.

    Indexing

    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)
    

    Querying

    index, _ := bleve.Open("example.bleve")
    query := bleve.NewQueryStringQuery("bleve")
    searchRequest := bleve.NewSearchRequest(query)
    searchResult, _ := index.Search(searchRequest)
    
    点赞 评论 复制链接分享
  • douguo6472 douguo6472 9年前

    You might also look at Apache Lucy, which is a "loose C" port of Lucene.

    点赞 评论 复制链接分享

相关推荐