Open
Description
I tried to declare a semantic field inside my dynamic mappings and failed:
"dynamic_templates": [
{
"semantic": {
"match": "semantic_*",
"mapping": {
"type": "semantic",
"model_id": "4j4iwZcB7dKCiuIqGvlV"
}
}
},
{
"textwithNgramSemantic": {
"match": "tnsem_*",
"mapping": {
"type": "text",
"analyzer": "standardWithStopwords",
"fields": {
"ngram": {
"type": "text",
"analyzer": "4gram"
},
"semantic": {
"type": "semantic",
"model_id": "4j4iwZcB7dKCiuIqGvlV"
}
}
}
}
}
]
No one of these get a _semantic_info
mapping entry, also inserting documents and searching them with neural search is not possible.
I then tried it without the dynamic pattern and declared two fields directly:
"properties": {
"semanticBody": {
"type": "semantic",
"model_id": "4j4iwZcB7dKCiuIqGvlV"
},
"semanticNgramBody": {
"type": "text",
"analyzer": "standardWithStopwords",
"fields": {
"ngram": {
"type": "text",
"analyzer": "4gram"
},
"semantic": {
"type": "semantic",
"model_id": "4j4iwZcB7dKCiuIqGvlV"
}
}
}
}
Only the semanticBody
that directly corresponds to the semantic field documentation gets a _semantic_info
mapping entry.
So there are 3 regular OpenSearch field declarations where semantic fields are not possible currently:
- Declaration as additional field inside a regular "mappings" => "properties" setting
- Declaration without internal/additional field as dynamic mapping under "mappings" => "dynamic_templates"
- Declaration as additional field inside the dynamic templates (the combination of 1. and 2.)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
On-deck