elasticsearch why i need to specify routing query parameter - elasticsearch

I have Elasticsearch 2.3.2 and Lucene 5.5.0.
Some indexes were already existing in my nodes with documents.
To search them I was using
GET /index/type/id
But when I created a new index. I have to search with
GET /index/type/id?routing=routing_name
To search with previous query method how should I create Index. I do see that records mapping structure is same as old data.
Also, why do I need to specify routing? In previous, it was not the case.
According to ElasticSearch documentation by default, we don't need to specify routing as id is default routing parameter. also, I have not specified {routing: {required: true}}anywhere while creating an index or adding a record.

Related

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 .

How about including JSON doc version? Is it possible for elastic search, to include different versions of JSON docs, to save and to search?

We are using ElasticSearch to save and manage information on complex transactions. We might need to add more information for every transaction, on the near future.
How about including JSON doc version?
Is it possible for elastic search, to include different versions of JSON docs, to save and to search?
How does this affects performance on ElasticSearch?
It's completely possible, By default elastic uses the dynamic mappings for every new documents such as your JSON documents to index them. For each field in your documents elastic creates a table called inverted_index and the search queries executed against them so regardless of your field variation as long as you know which field you want to execute query the data throughput and performance will not be affected.

Boosting search result based on each item in Solr Multivalued field

I am working on integrating Solr to my application. I have a List of keywords associated to each product. I use multivalued for Keyword field and indexed it. The problem is I want to Boost search result based on each item in the multivalued field in Solr index in order. (Currently I don't see order in the search result for multivalued field which I will fix it later.)
If I want to do this in my side I need to add different search fields and index them through Solr and set boost for each of them.
But I want to know if I use a list as multyvalued field in Solr can I do something like that without the cost of db schema change.
I am so new in Solr and if you find the question is so basic please give me any resource that gives me a hint to solve the problem. I am currently reading Apache Solr documentation and so far couldn't find anything that helps me.

ElasticSearch1.5 : Add new field in existing working Index

I have an existing index named as "MyIndex", which I am using to store a kind of data in ElasticSearch. That same index has millions of records. I am using ElasticSearch 1.5 version.
Now I have a new requirement for which I want to add two more fields in the same document which I am storing in "MyIndex" Index. Now I want to use both new schema and old schema documents in future.
What Can I do?
Can I inset new document in the same Index?
Are we need some changes in ElasticSearch mapping?
If we don't change anything, Is it affect on existing search capability?
Please help me to conclude this issue with your opinions.
Thanks in advance.
You can add new fields to existing index by updating mapping, but in many cases it would be just ok to index documents with new fields directly, and let ES infer types (although not always recommended) - but this will depend on what type of data you're indexing, and do you need special analyzers for strings or not.

Specifying data type and analyzer while creating index

I am using elastic search to index my data and i was able to do it with the following POST request
http://localhost:9200/index/type/id
{
JSON data over here
}
Yesterday while i was going through some of the elastic tutorials i found one person mentioning about setting analyzer to those fields where we are planning to do full text search.I found during my googling that mapping API can be used to update datatypes and analyzer, but in my case i want to do it as i am creating index.
How can i do it?
You can create index with custom settings (and mappings) in the first request and then index your data with second request. In this case you can not do both at the same time.
However if you index your data first and index does not exist yet, it will be created automatically with default settings. You can then update your mappings.
Source: Index

Resources