tomasloksa / azure-search-emulator

Containerized Azure Search Emulator for development purposes
MIT License
15 stars 3 forks source link

Fix index creating and same major refactor #32

Closed Burgyn closed 2 years ago

Burgyn commented 2 years ago

🪲 Bug Fixes

The main reason for this PR was to fix errors in creating the index. Index creation was called at the end of the Configure method in the Startup class (after app.UseRouting();). This meant that the incoming request to index the new data could overtake the indexing process, and then Solr automatically created the invalid schema for that data.

Moving this process before app.UseRouting ();, solved this problem.

🔨 Refactor

Refactor mainly concerns working with HttpClient (follow best practices)

✨ Minor improvements

Improved some logs. For example: if core was not define in docker-compose file, the creating schema failed without reasonable notice. New ====== Solr doesn't contain a definition of core for index{index.Name}. Callprecreate-core {index.Name};in entry point definition of your Solr docker image in docker-compose file. warning is logged.

Check and wait for Solr service in the start of index creating proces (method CheckAndThrowExceptionIfSolrIsNotAvailable).