ElasticSearch - search by property from concrete index while going through multiple indexes - elasticsearch

We're using ElasticSearch and we have two different indexes with different data. Recently, we wanted to make a query that needs data from both indexes. ES allows to search through multiple indexes: /index1,index2/_search. The problem is that both indexes have properties with the same name and there could be collisions because ES doesn't know on which index to search.
How can we tell ES to look up a property from concrete index?
For example: index1.myProperty and index2.otherProperty

Related

flattening dynamic indexes in elasticsearch

I use elasticsearch to record / index data from 'beats' and audit trails. The various beats often push records with > 1000 fields and this is causing issues.
I use dynamic indexes on everything so Im wondering if there's a way to tell elastic to 'flatten' all the values below a certain level into a single (possibly large) text field?

Elasticsearch data comparison

I have two different Elasticsearch clusters,
One cluster is Elastcisearch 6.x with the data, Second new Elasticsearch cluster 7.7.1 with pre-created indexes.
I reindexed data from Elastcisearch 6.x to Elastcisearch 7.7.1
Is there any way to get the doc from source and compare it with the target doc, in order to check that data is there and it is not affected somehow.
When you perform a reindex the data will be indexed based on destination index mapping, so if your mapping is same you should get the same result in search, the _source value will be unique on both indices but it doesn't mean your search result will be the same. If you really want to be sure everything is OK you should check the inverted index generated by both indices and compare them for fulltext search, this data can be really big and there is not an easy way to retrieve it, you can check this for getting term-document matrix .

What is the equivalent of creating MySQL indexes in Elasticsearch?

As you probably know, in MySQL you can create indexes to improve the performance of your queries. Is there any such equivalent in Elastic? (I already know that an index is somewhat the equivalent of creating a database in Elastic)
I just need confirmation from black-belt Elastic users ;)
From the documentation:
Relational databases add an index, such as a B-tree index, to specific
columns in order to improve the speed of data retrieval. Elasticsearch
and Lucene use a structure called an inverted index for exactly the
same purpose.
By default, every field in a document is indexed (has an inverted index) and thus is searchable. A field without an inverted index is
not searchable. We discuss inverted indexes in more detail in Inverted
Index.

Elasticsearch > Is it possible to build indices on base of FIELDS

In the context of ELK (Elasticsearch, Logstash, Kibana), I learnt that Logstash has FILTER to make use of grok to divide log messages into different fields. According to my understanding, it only helps to make the unstructured log data into more structured data. But I do no have any idea about how Elasticsearch can make use of the fields (done by grok) to improve the querying performance? Is it possible to build indices on base of the fields like in traditional relational database?
From Elasticsearch: The Definitive Guide
Inverted index
Relational databases add an index, such as a B-tree index, to specific columns in
order to improve the speed of data retrieval. Elasticsearch and Lucene use a
structure called an inverted index for exactly the same purpose.
By default, every field in a document is indexed (has an inverted
index) and thus is searchable. A field without an inverted index is
not searchable. We discuss inverted indexes in more detail in Inverted Index.
So you not need to do anything special. Elasticsearch already indexes all the fields by default.

Elastic search index capability?

We need a generic index where our properties are changing with every object. We need a fulltext search capability with a distributed system.
Could we index different objects in one generic index in elasticsearch?
Yes, elasticsearch allows to index different documents on the same index using a single dynamic mapping or, if you have only few different types of documents, you can have multiple mappings on the same index.

Resources