简体   繁体   中英

Create custom CRUD on elastic search

So, I have an application that extracts keywords from an elastic search document. I need to somehow run this application when my elastic search receives a new document to index so that the keywords generated get registered and stored with the document. Is there anyway to create a Plugin that extracts the keywords as soon as the document arrives?

"I need to somehow run this application when my elastic search receives a new document to index"

what you are describing requires a combination of an Ingest Pipeline and Ingest Plugin with a listener for indexing events.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html

the ingest pipleline lets you manipulate the incoming JSON, and the listener provides a hook for you to trigger any code you want.

Elastic.co don't usually provide good documentation for these kinds of things, but checkout the examples they have and their GitHub: https://github.com/elastic/elasticsearch/tree/master/plugins

I cannot think of an Elasticsearch plugin (I'm not aware of such a thing), but I'd rather recommend using Logstash, and configure the Elasticsearch input plugin to listen to updates in your cluster and use other plugins to react accordingly. To enable Logstash communicating with your application, an idea might be to add a REST endpoint to your app and let Logstash sending requests to that endpoint by using the Http output plugin .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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