Reputation: 6394
We are experiencing quite an interesting situation these days. We had ElasticSearch 6.2 previously and upgraded it to 7.1. It looks like some data that was saved with the old version is not compatible anymore with the new and I am looking for a solution.
This is an example of a record saved with the old version:
"_index" : "products-0_v7",
"_type" : "_doc",
"_id" : "18442_Product one.",
"_score" : 11.565834,
"_source" : {
"description" : "",
"priceExVat" : 15.65
}```
The problem is that this value can no longer be retrieved by the Nest library:
_client.Get<Product>(productId, x => x.Index(index))
When debugging the call, the period sign is stripped. The same thing happen during an Index operation:
var indexRequest = new IndexRequest<InvoicableProduct>(product, aliasErpimport, new Id(product.Id));
var ret = _client.Index(indexRequest);
Any idea on how to solve this? Is it possible to have the period not stripped at all? It works if you index a value such as "Product one. " (with an extra space) but that will create a duplicate since the original record has no trailing space.
Upvotes: 0
Views: 193
Reputation: 6394
After a few days of investigating the problem I came to a solution. After creating a new project from scratch and running the same code it worked so I had to figure out what was breaking it in the current code.
Web.config had a line of code similar to this one:
<httpRuntime maxRequestLength="2147483647" maxQueryStringLength="32768" maxUrlLength="65536" />
The problem, turns out, is that httpRuntime is lacking the targetFramework property.
This fixed it:
<httpRuntime targetFramework="4.8" maxRequestLength="2147483647" maxQueryStringLength="32768" maxUrlLength="65536" />
Upvotes: 0