Skip to content

Commit

Permalink
eitems: mappings: Add accent striping filters to document title
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 authored and kpsherva committed Jun 28, 2024
1 parent a0dca8c commit 766fd9a
Show file tree
Hide file tree
Showing 6 changed files with 661 additions and 4 deletions.
2 changes: 1 addition & 1 deletion invenio_app_ils/eitems/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class EItem(IlsRecord):
]

_pid_type = EITEM_PID_TYPE
_schema = "eitems/eitem-v2.0.0.json"
_schema = "eitems/eitem-v3.0.0.json"
_document_resolver_path = (
"{scheme}://{host}/api/resolver/eitems/{eitem_pid}/document"
)
Expand Down
179 changes: 179 additions & 0 deletions invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v3.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"settings": {
"analysis": {
"normalizer": {
"custom_normalizer": {
"type": "custom",
"char_filter": ["strip_special_chars"],
"filter": ["lowercase", "asciifolding"]
}
},
"analyzer": {
"custom_analyzer": {
"tokenizer": "standard",
"type": "custom",
"char_filter": ["strip_special_chars"],
"filter": ["lowercase", "asciifolding"]
}
},
"filter": {
"asciifolding": {
"type": "asciifolding"
}
},
"char_filter": {
"strip_special_chars": {
"type": "pattern_replace",
"pattern": "[\\p{Punct}\\p{S}]",
"replacement": ""
}
}
}
},
"mappings": {
"date_detection": false,
"numeric_detection": false,
"properties": {
"$schema": {
"type": "keyword"
},
"_created": {
"type": "date"
},
"_updated": {
"type": "date"
},
"bucket_id": {
"type": "keyword"
},
"created_by": {
"properties": {
"type": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
},
"type": "object"
},
"description": {
"type": "text"
},
"document": {
"properties": {
"authors": {
"type": "text"
},
"cover_metadata": {
"properties": {},
"type": "object"
},
"edition": {
"type": "text"
},
"pid": {
"type": "keyword"
},
"publication_year": {
"type": "keyword"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
},
"normalized_keyword": {
"type": "keyword",
"normalizer": "custom_normalizer"
}
},
"analyzer": "custom_analyzer",
"search_analyzer": "custom_analyzer"
}
},
"type": "object"
},
"document_pid": {
"type": "keyword"
},
"eitem_type": {
"type": "keyword"
},
"files": {
"properties": {
"bucket": {
"type": "keyword"
},
"checksum": {
"type": "keyword"
},
"file_id": {
"type": "keyword"
},
"key": {
"type": "keyword"
},
"size": {
"type": "keyword"
},
"version_id": {
"type": "keyword"
}
},
"type": "object"
},
"identifiers": {
"properties": {
"material": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
}
},
"type": "object"
},
"internal_notes": {
"type": "text"
},
"open_access": {
"type": "boolean"
},
"pid": {
"type": "keyword"
},
"source": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
},
"urls": {
"properties": {
"description": {
"type": "text"
},
"value": {
"type": "keyword"
},
"login_required": {
"type": "boolean"
}
},
"type": "object"
}
}
}
}
179 changes: 179 additions & 0 deletions invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v3.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"settings": {
"analysis": {
"normalizer": {
"custom_normalizer": {
"type": "custom",
"char_filter": ["strip_special_chars"],
"filter": ["lowercase", "asciifolding"]
}
},
"analyzer": {
"custom_analyzer": {
"tokenizer": "standard",
"type": "custom",
"char_filter": ["strip_special_chars"],
"filter": ["lowercase", "asciifolding"]
}
},
"filter": {
"asciifolding": {
"type": "asciifolding"
}
},
"char_filter": {
"strip_special_chars": {
"type": "pattern_replace",
"pattern": "[\\p{Punct}\\p{S}]",
"replacement": ""
}
}
}
},
"mappings": {
"date_detection": false,
"numeric_detection": false,
"properties": {
"$schema": {
"type": "keyword"
},
"_created": {
"type": "date"
},
"_updated": {
"type": "date"
},
"bucket_id": {
"type": "keyword"
},
"created_by": {
"properties": {
"type": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
},
"type": "object"
},
"description": {
"type": "text"
},
"document": {
"properties": {
"authors": {
"type": "text"
},
"cover_metadata": {
"properties": {},
"type": "object"
},
"edition": {
"type": "text"
},
"pid": {
"type": "keyword"
},
"publication_year": {
"type": "keyword"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
},
"normalized_keyword": {
"type": "keyword",
"normalizer": "custom_normalizer"
}
},
"analyzer": "custom_analyzer",
"search_analyzer": "custom_analyzer"
}
},
"type": "object"
},
"document_pid": {
"type": "keyword"
},
"eitem_type": {
"type": "keyword"
},
"files": {
"properties": {
"bucket": {
"type": "keyword"
},
"checksum": {
"type": "keyword"
},
"file_id": {
"type": "keyword"
},
"key": {
"type": "keyword"
},
"size": {
"type": "keyword"
},
"version_id": {
"type": "keyword"
}
},
"type": "object"
},
"identifiers": {
"properties": {
"material": {
"type": "keyword"
},
"scheme": {
"type": "keyword"
},
"value": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
}
},
"type": "object"
},
"internal_notes": {
"type": "text"
},
"open_access": {
"type": "boolean"
},
"pid": {
"type": "keyword"
},
"source": {
"type": "keyword",
"fields": {
"text": {
"type": "text"
}
}
},
"urls": {
"properties": {
"description": {
"type": "text"
},
"value": {
"type": "keyword"
},
"login_required": {
"type": "boolean"
}
},
"type": "object"
}
}
}
}
Loading

0 comments on commit 766fd9a

Please sign in to comment.