Reputation: 96
I'm using Hibernate Search 6 which uses AWS Java SDK 2.x Here is the mapping of my index:
{
"my-test": {
"aliases": {
"my-test-read": {
"is_write_index": false
},
"my-test-write": {
"is_write_index": true
}
},
"mappings": {
"dynamic": "strict",
"_source": {
"enabled": false
},
"properties": {
"_entity_type": {
"type": "keyword",
"index": false
},
"country": {
"type": "keyword",
"normalizer": "lowercase"
},
"createdAt": {
"type": "date",
"doc_values": false,
"format": "uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS"
},
"description": {
"type": "text"
},
"eventName": {
"type": "keyword",
"normalizer": "lowercase"
},
"ipAddress": {
"type": "keyword",
"normalizer": "lowercase"
},
"sellerId": {
"type": "integer"
},
"sellerUuid": {
"type": "keyword"
},
"sourceService": {
"type": "keyword",
"normalizer": "lowercase"
},
"userEmail": {
"type": "keyword",
"normalizer": "lowercase"
},
"userId": {
"type": "integer"
},
"userUuid": {
"type": "keyword"
}
}
},
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "1",
"provided_name": "my-test",
"creation_date": "1630502414724",
"analysis": {
"normalizer": {
"lowercase": {
"filter": [
"lowercase",
"asciifolding"
],
"type": "custom"
}
}
},
"number_of_replicas": "1",
"uuid": "YUBxPc0bSy-vncS8Z_hy7Q",
"version": {
"created": "7120099"
}
}
}
}
}
When description
field is long and it contains special characters like【
(\u3010)
I get this error from Elasticsearch
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Here is my original message:
{
"createdAt": "2021-09-01T13:23:39.255160252",
"sourceService": "Product",
"eventName": "product_attribute_updated",
"country": "UK",
"userId": 1234,
"userUuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"userEmail": "[email protected]",
"sellerId": 1234,
"sellerUuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"description": "Product attribute 'description' for '7 Inches Ceramic Stripe Serving Bowl Set of 6' (variations: (SKU: AAAAAAAAA-6P \/ Shop SKU: - \/ ID: 1234567)) has been changed from \"\u3010IDEAL SIZE FOR SALAD\u3011Perfect size 7 inches to 10 inches Diameter, awesome every kitchen should have one. LE TAUCI bowl with cute unique style, artistic shape make an amazing presentation on your table.<br \/>\n<br \/>\n\u3010ELEGANT MODERN STYLING\u3011The unique rim and circle of the bowl make your dinner more outstanding.The higher sides of the bowl allow you to better Orient the bowl as you stir the salad and make the dressing more even<br \/>\n<br \/>\n\u3010NO ODOR AND EASY TO CLEAN\u3011Just put it in the dishwasher or rinse it with water.In spite of long use, the bowl does not fade or become moldy<br \/>\n<br \/>\n\u3010THE BEST QUALITY THINGS FOR YOU\u3011These bowls are made of some strong stuff. They are proudly quality approved stoneware. Lead-free and cadmium-free for your healthy life. The superior durability and edge strength will ensure years of use.\" to \"<div>- Ideal size for salad: perfect size 7 inches to 10 inches diameter, awesome every kitchen should have one. Le tauci bowl with cute unique style, artistic shape make an amazing presentation on your table.<\/div><div>- Elegant modern styling: the unique rim and circle of the bowl make your dinner more outstanding. The higher sides of the bowl allow you to better orient the bowl as you stir the salad and make the dressing more even<\/div><div>- No odor and easy to clean: just put it in the dishwasher or rinse it with water. In spite of long use, the bowl does not fade or become moldy<\/div><div>- The best quality things for you: these bowls are made of some strong stuff. They are proudly quality approved stoneware. Lead-free and cadmium-free for your healthy life. The superior durability and edge strength will ensure years of use.<\/div>\"",
"ipAddress": "127.0.0.1"
}
And this is the complete error log:
2021-09-01 13:23:39.269 DEBUG 1 --- [port thread - 4] o.h.search.elasticsearch.request : HSEARCH400082: Executed Elasticsearch HTTP POST request to 'http://myhost:80' with path '/_bulk', query parameters POST and 2 objects in payload in 4ms. Response had status 403 'Forbidden'. Request body: <{"index":{"_index":"my-test","_id":"18654"}}\n{"createdAt":"2021-09-01T13:23:39.255160252","country":"UK","description":"Product attribute \u0027description\u0027 for \u00277 Inches Ceramic Stripe Serving Bowl Set of 6\u0027 (variations: (SKU: AAAAAAAAA-6P / Shop SKU: - / ID: 1234567)) has been changed from \"【IDEAL SIZE FOR SALAD】Perfect size 7 inches to 10 inches\u0026nbsp;Diameter, awesome \u0026nbsp;every kitchen should have one. LE TAUCI bowl with cute unique style, artistic shape make an amazing presentation on your table.\u003cbr /\u003e\n\u003cbr /\u003e\n【ELEGANT MODERN STYLING】The unique rim and circle of the bowl make your dinner more outstanding.The higher sides of the bowl allow you to better Orient the bowl as you stir the salad and make the dressing more even\u003cbr /\u003e\n\u003cbr /\u003e\n【NO ODOR AND EASY TO CLEAN】Just put it in the dishwasher or rinse it with water.In spite of long use, the bowl does not fade or become moldy\u003cbr /\u003e\n\u003cbr /\u003e\n【THE BEST QUALITY THINGS FOR YOU】These bowls are made of some strong stuff. They are proudly quality approved stoneware. Lead-free and cadmium-free for your healthy life. The superior durability and edge strength will ensure years of use.\" to \"\u003cdiv\u003e- Ideal size for salad: perfect size 7 inches to 10 inches diameter, awesome\u0026nbsp; every kitchen should have one. Le tauci bowl with cute unique style, artistic shape make an amazing presentation on your table.\u003c/div\u003e\u003cdiv\u003e- Elegant modern styling: the unique rim and circle of the bowl make your dinner more outstanding. The higher sides of the bowl allow you to better orient the bowl as you stir the salad and make the dressing more even\u003c/div\u003e\u003cdiv\u003e- No odor and easy to clean: just put it in the dishwasher or rinse it with water. In spite of long use, the bowl does not fade or become moldy\u003c/div\u003e\u003cdiv\u003e- The best quality things for you: these bowls are made of some strong stuff. They are proudly quality approved stoneware. Lead-free and cadmium-free for your healthy life. The superior durability and edge strength will ensure years of use.\u003c/div\u003e\"","eventName":"product_attribute_updated","ipAddress":"127.0.0.1","sellerId":1234,"sellerUuid":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","sourceService":"Product","userEmail":"[email protected]","userId":1234,"userUuid":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","_entity_type":"MyTest"}>. Response body: <{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}>
\u
s with \\u
for example \u3010
-> \\u3010
,
it worksID: 1234567
with ID: 123
, it worksI was thinking of asciifolding
as cause of the issue, but why It works when I just remove some normal characters?
Upvotes: 2
Views: 103
Reputation: 96
I upgraded to Hibernate Search 6.0.6.Final and it's working (for this sample message at least)
Upvotes: 1