首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elasticsearch插件:如何索引文件?

Elasticsearch插件:如何索引文件?
EN

Stack Overflow用户
提问于 2015-11-03 09:54:56
回答 2查看 451关注 0票数 1

是否有可能通过elasticsearch grails插件上传和索引文件?

https://github.com/elastic/elasticsearch-mapper-attachments插件安装在我的elasticsearch服务器上。

Elasticsearch文档http://noamt.github.io/elasticsearch-grails-plugin/没有提到文件的映射。

域类可能如下所示:

代码语言:javascript
复制
class Document {
     String filecontent

     static searchable = {
       only = ["filecontent"]
       filecontent attachment:true
      }
}

其中文件是base64编码的文件。实际上,这是可行的,但我无法使突出显示的工作。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-11-04 16:54:23

目前,不可能用elasticsearch-grails的标准索引映射来突出显示上传的内容。

我在这里解释了一个解决办法:https://github.com/noamt/elasticsearch-grails-plugin/issues/131

票数 1
EN

Stack Overflow用户

发布于 2015-11-03 16:09:34

好吧,弹性搜索插件,只要您使用static search字段创建或更新任何域实例,就可以这样做。

但是,如果要强制执行,可以在一个临时操作中注入bean elasticSearchService,并在其上调用index()方法。

这将索引您的实例。

http://noamt.github.io/elasticsearch-grails-plugin/ref/ElasticSearchService/index.html

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

https://stackoverflow.com/questions/33496041

复制
相关文章

相似问题

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