Cannot override index names through configuration properties with Elasticsearch
Description
Activity

Cary.yu December 23, 2016 at 11:37 AM
Okay, I've seen your code on github, I think I've got an idea to solve it, thx.

Yoann Rodière December 23, 2016 at 11:23 AMEdited
Ok. The only other alternative I can see for now is programmatic mapping, which theoretically could fit your use case, but it seems a bit too much just to override an index name.
Anyway, fear not: we have a fix and it will definitely make it into 5.6.0.Final. The fix is currently undergoing review.

Cary.yu December 22, 2016 at 11:13 AM
Actually the annotation way currently isn't suitable for what I need, because of that I am using Spring Configuration YAML to manage multiple environments, so I need to override the index name by different one.

Yoann Rodière December 22, 2016 at 8:56 AMEdited
Thank you very much for reporting this bug. I managed to reproduce it and I'm currently trying to solve it.
In the meantime, if you use annotation mapping, you should be able to override the index name with @Indexed(index = "DefaultCompany")
.
EDIT: fix an error in my code snippet. It's Indexed.index
, not Indexed.name
.
Details
Details
Assignee

Reporter

the problem comes out while I'm trying to use Sharing Indexes feature to rename the each index; i set the breakpoint at ElasticsearchIndexManager line 141 and IndexManagerHolder line 92 finding out that two names are different which causes WorkQueuePerIndexSplitter line 31 indexManagerHolder.getBackendQueueProcessor( indexName ) to be Null , but i'm not sure whether or not it's an issue.
<property name="hibernate.search.com.xxx.xxx.xxx.Company.indexName" value="DefaultCompany"/>