Elasticsearch preguntas y respuestas de entrevista
Pregunta 31. What is a shard in Elasticsearch?
A shard is a basic unit of storage and search in Elasticsearch. Indexes are divided into shards to distribute data across multiple nodes for scalability.
Example:
PUT /my_index/_settings
{
"number_of_shards": 5
}
Pregunta 32. How does Elasticsearch handle security?
Elasticsearch provides security features like role-based access control, SSL/TLS encryption, and authentication mechanisms.
Pregunta 33. Explain the purpose of the term 'mapping' in Elasticsearch.
Mapping in Elasticsearch is the process of defining how a document and its fields are stored and indexed. It helps in defining the data type, analysis, and other properties.
Example:
PUT /my_index
{
"mappings": {
"properties": {
"title": { "type": "text" }
}
}
}
Pregunta 34. Explain the term 'Bulk API' in Elasticsearch.
The Bulk API allows for the efficient indexing and deletion of multiple documents in a single request.
Pregunta 35. What is the role of a filter in Elasticsearch?
Filters in Elasticsearch are used to narrow down the search results based on specific criteria. They are applied to queries to exclude or include documents in the search.
Example:
GET /my_index/_search
{
"query": {
"bool": {
"filter": {
"range": {
"price": { "gte": 20 }
}
}
}
}
}
Lo mas util segun los usuarios: