我使用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 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 />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, 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"
}
这是完整的错误日志:
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: 123
代替ID: 1234567
,它工作 - 如果我禁用签名,它工作
我认为asciifolding
作为问题的原因,但为什么它的工作,当我只是删除一些正常字符?
我升级到Hibernate Search 6.0.6。最后,它正在工作(至少对于这个示例消息)