是否有可能通过elasticsearch grails插件上传和索引文件?
https://github.com/elastic/elasticsearch-mapper-attachments插件安装在我的elasticsearch服务器上。
Elasticsearch文档http://noamt.github.io/elasticsearch-grails-plugin/没有提到文件的映射。
域类可能如下所示:
class Document {
String filecontent
static searchable = {
only = ["filecontent"]
filecontent attachment:true
}
}其中文件是base64编码的文件。实际上,这是可行的,但我无法使突出显示的工作。
发布于 2015-11-04 16:54:23
目前,不可能用elasticsearch-grails的标准索引映射来突出显示上传的内容。
我在这里解释了一个解决办法:https://github.com/noamt/elasticsearch-grails-plugin/issues/131
发布于 2015-11-03 16:09:34
好吧,弹性搜索插件,只要您使用static search字段创建或更新任何域实例,就可以这样做。
但是,如果要强制执行,可以在一个临时操作中注入bean elasticSearchService,并在其上调用index()方法。
这将索引您的实例。
http://noamt.github.io/elasticsearch-grails-plugin/ref/ElasticSearchService/index.html
https://stackoverflow.com/questions/33496041
复制相似问题