Epinova / Epinova.Elasticsearch

A search-plugin for Episerver CMS and Commerce
MIT License
29 stars 20 forks source link

Null reference when creating index #91

Closed Hakuren92 closed 2 years ago

Hakuren92 commented 4 years ago

I am in the process of integrating elasticsearch into an existing EPiServer project. I've followed the instructions under the installation page and I am able to navigate to the ElasticSearchAdmin page in the EPi admin interface.

Epinova.Elasticsearch: v11.7.1.29 ElasticSearch: v7.4.0 EPiServer: v11.13.1 EPiServer.CMS.UI: v11.22.0 EPiServer.Commerce: v13.9.0

When I try to create new indices i get this issue:

[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.Dynamic.ExpandoObject.TryAddMember(String key, Object value) +3634686
   Epinova.ElasticSearch.Core.Utilities.Analyzers.CreateAnalyzer(String languageName) in C:\projects\epinova-elasticsearch\src\Epinova.ElasticSearch.Core\Utilities\Analyzers.cs:149
   Epinova.ElasticSearch.Core.Utilities.Analyzers.GetAnalyzerSettings(String languageCode, String synonymsFilePath) in C:\projects\epinova-elasticsearch\src\Epinova.ElasticSearch.Core\Utilities\Analyzers.cs:25
   Epinova.ElasticSearch.Core.Admin.Index.CreateAnalyzerSettings() in C:\projects\epinova-elasticsearch\src\Epinova.ElasticSearch.Core\Admin\Index.cs:245
   Epinova.ElasticSearch.Core.Admin.Index.Initialize(Type type) in C:\projects\epinova-elasticsearch\src\Epinova.ElasticSearch.Core\Admin\Index.cs:159
   Epinova.ElasticSearch.Core.EPiServer.Controllers.ElasticAdminController.AddNewIndex() in C:\projects\epinova-elasticsearch\src\Epinova.ElasticSearch.Core.EPiServer\Controllers\ElasticAdminController.cs:69
   lambda_method(Closure , ControllerBase , Object[] ) +87
...

However, the index in question is created but will remain empty. Once it hits the error point I have to navigate back to the button and press it again in order to create the next index; but they will all produce the same issue. Once all of the indices for our languages have been created (we have 12 active languages) the page will only reload when I press the "Create / Update indices" button. No error message will be presented but nothing seems to be happening.

Is there something I've missed in the setup? Is there any additional information that I can gather from the system in order to narrow the search for a solution?

Given the error message above I am guessing that "languageName" somehow is null which makes me wonder if the plugin actually has access to our pages as I have not found a page with a null language.

otanum commented 2 years ago

This was probably solved in v11.7.4.214