- Elasticsearch - Discussion
- Elasticsearch - Useful Resources
- Elasticsearch - Quick Guide
- Elasticsearch - Logs UI
- Elasticsearch - Canvas
- Elasticsearch - Heat Maps
- Elasticsearch - Tag Clouds
- Elasticsearch - Time Series
- Elasticsearch - Area and Bar Charts
- Elasticsearch - Pie Charts
- Elasticsearch - Region Maps
- Elasticsearch - Data Tables
- Elasticsearch - Filtering by Field
- Elasticsearch - Kibana Dashboard
- Elasticsearch - Testing
- Elasticsearch - Frozen Indices
- Elasticsearch - Rollup Data
- Elasticsearch - Monitoring
- Elasticsearch - SQL Access
- Elasticsearch - Managing Index Lifecycle
- Elasticsearch - Ingest Node
- Elasticsearch - Index Modules
- Elasticsearch - Modules
- Elasticsearch - Analysis
- Elasticsearch - Mapping
- Elasticsearch - Query DSL
- Elasticsearch - Cluster APIs
- Elasticsearch - CAT APIs
- Elasticsearch - Index APIs
- Elasticsearch - Aggregations
- Elasticsearch - Search APIs
- Elasticsearch - Document APIs
- Elasticsearch - API Conventions
- Migration between Versions
- Elasticsearch - Populate
- Elasticsearch - Installation
- Elasticsearch - Basic Concepts
- Elasticsearch - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Elasticsearch - IngestNode
index.blocks.read_only | 1 true/false | Set to true to make the index and index metadata read only, false to allow writes and metadata changes. |
Sometimes we need to transform a document before we index it. For instance, we want to remove a field from the document or rename a field and then index it. This is handled by Ingest node.
Every node in the cluster has the abipty to ingest but it can also be customized to be processed only by specific nodes.
Steps Involved
There are two steps involved in the working of the ingest node −
Creating a pipepne
Creating a doc
Create a Pipepne
First creating a pipepne which contains the processors and then executing the pipepne, as shown below −
PUT _ingest/pipepne/int-converter { "description": "converts the content of the seq field to an integer", "processors" : [ { "convert" : { "field" : "seq", "type": "integer" } } ] }
On running the above code, we get the following result −
{ "acknowledged" : true }
Create a Doc
Next we create a document using the pipepne converter.
PUT /logs/_doc/1?pipepne=int-converter { "seq":"21", "name":"Tutorialspoint", "Addrs":"Hyderabad" }
On running the above code, we get the response as shown below −
{ "_index" : "logs", "_type" : "_doc", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "_seq_no" : 0, "_primary_term" : 1 }
Next we search for the doc created above by using the GET command as shown below −
GET /logs/_doc/1
On running the above code, we get the following result −
{ "_index" : "logs", "_type" : "_doc", "_id" : "1", "_version" : 1, "_seq_no" : 0, "_primary_term" : 1, "found" : true, "_source" : { "Addrs" : "Hyderabad", "name" : "Tutorialspoint", "seq" : 21 } }
You can see above that 21 has become an integer.
Without Pipepne
Now we create a document without using the pipepne.
PUT /logs/_doc/2 { "seq":"11", "name":"Tutorix", "Addrs":"Secunderabad" } GET /logs/_doc/2
On running the above code, we get the following result −
{ "_index" : "logs", "_type" : "_doc", "_id" : "2", "_version" : 1, "_seq_no" : 1, "_primary_term" : 1, "found" : true, "_source" : { "seq" : "11", "name" : "Tutorix", "Addrs" : "Secunderabad" } }
You can see above that 11 is a string without the pipepne being used.
Advertisements