简体   繁体   English

ElasticSearch:纯文本文件而不是JSON

[英]ElasticSearch : plain text file instead of JSON

Interested in elasticsearch and working with txt files not json. 对elasticsearch和使用txt文件而不是json感兴趣。 Can elasticsearch support plain text file? Elasticsearch可以支持纯文本文件吗? If yes, Is there any java API, I can use ( I tested crud operations with postman on JSON document and it's working fine ) Thanks for the help. 如果是,是否可以使用任何Java API(我在JSON文档中用邮递员测试了crud操作,并且工作正常)谢谢您的帮助。

No, the elasticsearch document api supports only JSON. 不,elasticsearch文档api仅支持JSON。

But there is a workaround for this problem using ingestion pipelines running on ingestion nodes in your cluster https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html . 但是,可以使用在群集https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html的群集中的摄取节点上运行的摄取管道来解决此问题。 By defaut each elasticsearch server instance is a ingestion node. 通过默认,每个elasticsearch服务器实例都是一个摄取节点。

Please have a look on this wery well described approach for CSV https://www.elastic.co/de/blog/indexing-csv-elasticsearch-ingest-node which is easily adaptable for flat files. 请看一下这种针对CSV的详尽描述的方法https://www.elastic.co/de/blog/indexing-csv-elasticsearch-ingest-node ,它很容易适应平面文件。

Another option is to use a second tool like Filebeat or Logstash for file ingestion. 另一种选择是使用Filebeat或Logstash之类的第二个工具来提取文件。 Have a look here: https://www.elastic.co/products/beats or here https://www.elastic.co/products/logstash 在这里看看: https : //www.elastic.co/products/beats或在这里https://www.elastic.co/products/logstash

Having a Filebeat in place will solve many problems with minimal effort. 设置Filebeat将以最小的努力解决许多问题。 Give it a chance ;) 给它一个机会;)

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

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