#aws-java-sdk-2.x #hibernate-search-6
Вопрос:
Я использую Hibernate Search 6, который использует AWS Java SDK 2.x Вот отображение моего индекса:
{
"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"
}
}
}
}
}
Когда description
поле длинное и содержит специальные символы, такие как 【
(u3010)
Я получаю эту ошибку от Elasticsearch
Подпись запроса, которую мы рассчитали, не совпадает с предоставленной вами подписью. Проверьте свой секретный ключ доступа AWS и способ подписи. Для получения подробной информации обратитесь к сервисной документации.
Вот мое первоначальное сообщение:
{
"createdAt": "2021-09-01T13:23:39.255160252",
"sourceService": "Product",
"eventName": "product_attribute_updated",
"country": "UK",
"userId": 1234,
"userUuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"userEmail": "a@company.com",
"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 SALADu3011Perfect size 7 inches to 10 inchesamp;nbsp;Diameter, awesome amp;nbsp;every kitchen should have one. LE TAUCI bowl with cute unique style, artistic shape make an amazing presentation on your table.<br />n<br />nu3010ELEGANT MODERN STYLINGu3011The 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 />nu3010NO ODOR AND EASY TO CLEANu3011Just 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 />nu3010THE BEST QUALITY THINGS FOR YOUu3011These 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, awesomeamp;nbsp; 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"
}
И это полный журнал ошибок:
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 u0027descriptionu0027 for u00277 Inches Ceramic Stripe Serving Bowl Set of 6u0027 (variations: (SKU: AAAAAAAAA-6P / Shop SKU: - / ID: 1234567)) has been changed from "【IDEAL SIZE FOR SALAD】Perfect size 7 inches to 10 inchesu0026nbsp;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 /u003enu003cbr /u003en【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 evenu003cbr /u003enu003cbr /u003en【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 moldyu003cbr /u003enu003cbr /u003en【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 "u003cdivu003e- Ideal size for salad: perfect size 7 inches to 10 inches diameter, awesomeu0026nbsp; every kitchen should have one. Le tauci bowl with cute unique style, artistic shape make an amazing presentation on your table.u003c/divu003eu003cdivu003e- 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 evenu003c/divu003eu003cdivu003e- 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 moldyu003c/divu003eu003cdivu003e- 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/divu003e"","eventName":"product_attribute_updated","ipAddress":"127.0.0.1","sellerId":1234,"sellerUuid":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","sourceService":"Product","userEmail":"a@company.com","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,\u
напримерu3010
, ->>\u3010
,
это сработает - Если я уменьшу размер описания (например , заменю
ID: 1234567
наID: 123
, это работает - Если я отключу подпись, это сработает
Я думал о asciifolding
причине проблемы, но почему это работает, когда я просто удаляю некоторые обычные символы?
Ответ №1:
Я обновился до Hibernate Search 6.0.6.Final, и он работает (по крайней мере, для этого примера сообщения).