简体   繁体   English

弹性响应修改器插件

[英]Elastic Response modifier Plugin

is it possible implement plugin modify search response from elastic?是否可以实现插件修改来自弹性的搜索响应?

In Solr we can extend SearchHandler to modify response from solr.在 Solr 中,我们可以扩展 SearchHandler 来修改来自 solr 的响应。

use case - calling external service find authorization and return authorized data in response.用例- 调用外部服务查找授权并返回授权数据作为响应。 Intercept query response and call external service and find authorized and return those authorized in response.拦截查询响应并调用外部服务并找到授权并返回授权的响应。 Thanks谢谢

You could inject a new FetchSubPhase by a custom search plugin :您可以通过自定义搜索插件注入新的FetchSubPhase

https://github.com/elastic/elasticsearch/blob/b84a6ed5e6fc1e057f8c0f4d6758a80b3d2a51fd/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java#L84 https://github.com/elastic/elasticsearch/blob/b84a6ed5e6fc1e057f8c0f4d6758a80b3d2a51fd/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java#L84

However, to make outbound calls - you will need to modify jvm security policy.但是,要进行出站调用 - 您需要修改 jvm 安全策略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM