【问题标题】:Elasticsearch Grails Plugin: How to index files?Elasticsearch Grails 插件:如何索引文件?
【发布时间】:2015-11-05 00:54:23
【问题描述】:

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

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

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

域类可能如下所示:

class Document {
     String filecontent

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

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

【问题讨论】:

    标签: grails elasticsearch-plugin


    【解决方案1】:

    目前无法使用来自 elasticsearch-grails-plugin 的标准索引映射突出显示上传的内容。

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

    【讨论】:

      【解决方案2】:

      只要您使用static search 字段创建或更新任何域实例,弹性搜索插件就会为您执行此操作。

      但是如果你想强行做,你可以在一个临时的动作中注入beanelasticSearchService,然后在上面调用index()方法。

      这将为您的实例编制索引。

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

      【讨论】:

      • 是的,我知道。但目前我的问题是配置索引以突出显示使用 mapper-attachments-plugin 索引的内容
      猜你喜欢
      • 2014-08-02
      • 1970-01-01
      • 2017-06-25
      • 2016-06-28
      • 2011-12-22
      • 2016-10-18
      • 2018-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多