index_not_found_exception during query to Elasticsearch

Description

I am using a SearchIntegrator pre-configured with two entities, TestEntity and AnotherTestEntity, using index names indexa and indexb respectively.

Initially only entries of type TestEntity are indexed, and when querying the following exception is thrown:

By default the Elasticsearch is considering all indexes when querying but apparently only one index was created

Environment

None

Activity

Show:
Yoann Rodière
October 3, 2016, 2:15 PM

I think we'd better try to determine why the index is unavailable before doing what's done in your PR (i.e. ignoring the error).
Could you please provide more information about your error? A failing test case would be the best: you may find a template here.

If you cannot provide a test case, maybe you have the full error log available, especially with the startup logs? I'm wondering what happened for the index to be reported missing.

Also, what configuration are you using? Did you set hibernate.search.default.elasticsearch.index_schema_management_strategy (or the equivalent for indexa or indexb) to something other than the default?

Gustavo Fernandes
October 3, 2016, 2:43 PM

Hi , I did not set the schema management property, I was assuming the behaviour would be the same as the DirectoryBasedIndexManager, i.e. indexes created when the session factory boots up.

Probably there's a couple of issues here: the default schema management strategy is to not create the index, plus I also noticed the elastic search query targets both indexa, indexb when I explicitly created the query targeting TestEntity:

I will work on a reproducer

Yoann Rodière
October 4, 2016, 9:35 AM

Thanks for your feedback. I'm closing this ticket, but I created to address the documentation issue.
Feel free to open another ticket about the wrong index targets!

Rejected

Assignee

Gustavo Fernandes

Reporter

Gustavo Fernandes

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Priority

Major
Configure