I created a alias that contain multiple indices and I can get data without
any error but insert/update data via alias that show below message
{
"error": "ElasticsearchIllegalArgumentException[Alias [data-active] has
more than one indices associated with it [[data-v4, data-v2, data-v3]],
can't execute a single index op]",
"status": 400
}
Actually, inserting and updating are working on data-v4 only but I need to
do via alias because I can reuse application code without any change.
Is it possible to configure something to do like that?
You can't use aliases which point to multiple indexes for indexing
operations. This is because there is no way of elasticsearch knowing which
index in your alias you want to apply the indexing operation to.
What you can do instead is to create another alias called something like
'data-write' and point it at the index you want to use to write data to.
This way your application can always point to the alias (data-write) to
write data and the alias (data-active) to read data. Then you can change
the index in 'data-write' when the index you are wanting to write to
changes (making sure you do the add an remove in a single request, example
in [1]) and you can change the indexes in 'data-active' when the indexes
you want to read/search from change.
On Wednesday, 18 February 2015 09:43:53 UTC, tao hiko wrote:
Hello,
I created a alias that contain multiple indices and I can get data without
any error but insert/update data via alias that show below message
{
"error": "ElasticsearchIllegalArgumentException[Alias [data-active] has
more than one indices associated with it [[data-v4, data-v2, data-v3]],
can't execute a single index op]",
"status": 400
}
Actually, inserting and updating are working on data-v4 only but I need to
do via alias because I can reuse application code without any change.
Is it possible to configure something to do like that?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.