Skip to content

Commit

Permalink
[OSDEV-1103] Enable accent-insensitive search in OpenSearch for the p…
Browse files Browse the repository at this point in the history
…roduction location name and address. (#326)

[OSDEV-1103](https://opensupplyhub.atlassian.net/browse/OSDEV-1103) API
v1/production-locations. Enable accent-insensitive search in OpenSearch
for the production location name and address.

Enabled accent-insensitive search for `name` and `address` fields of
production location by designing the index mapping to do ASCII folding
for search tokens.

[OSDEV-1103]:
https://opensupplyhub.atlassian.net/browse/OSDEV-1103?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
mazursasha1990 authored Aug 16, 2024
1 parent 5c51481 commit b241e3a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
* `grouped` (optional): If present, returns sectors grouped by their sector groups.
* [OSDEV-1184](https://opensupplyhub.atlassian.net/browse/OSDEV-1184) - Handle validation errors for size, sort_by and order_by parameters of "api/v1/production-locations" endpoint.
* [OSDEV-982](https://opensupplyhub.atlassian.net/browse/OSDEV-982) - Search, API. Add OS ID query parameter to v1/production-locations. Implement "api/v1/production-locations/{os_id}" endpoint.
* [OSDEV-1103](https://opensupplyhub.atlassian.net/browse/OSDEV-1103) - Enabled accent-insensitive search for `name` and `address` fields of production location by designing the index mapping to do ASCII folding for search tokens.

### Architecture/Environment changes
* [OSDEV-1165](https://opensupplyhub.atlassian.net/browse/OSDEV-1165) - Updated the release protocol to include information about quick fixes and how to perform them. Additionally, updated the GitFlow diagram to visually depict this process.
Expand Down
20 changes: 20 additions & 0 deletions src/logstash/indexes/production_locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,32 @@
"production-locations*"
],
"template": {
"settings": {
"analysis": {
"analyzer": {
"custom_asciifolding_analyzer": {
"tokenizer": "standard",
"filter": [
"custom_asciifolding_filter"
]
}
},
"filter": {
"custom_asciifolding_filter": {
"type": "asciifolding",
"preserve_original": true
}
}
}
},
"mappings": {
"properties": {
"os_id": {
"type": "keyword"
},
"name": {
"type": "text",
"analyzer": "custom_asciifolding_analyzer",
"fields": {
"keyword": {
"type": "keyword"
Expand All @@ -34,6 +53,7 @@
},
"address": {
"type": "text",
"analyzer": "custom_asciifolding_analyzer",
"fields": {
"keyword": {
"type": "keyword"
Expand Down

0 comments on commit b241e3a

Please sign in to comment.