Invalid parameter contexts in Completion suggest
I was trying to add context to the completion field like this:
"title__suggest": {
"type": "completion",
"contexts": [
{
"name": "user",
"type": "category",
"path": "user_id"
}
]
}
But got this error, is contexts not supported in pgsync?
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pgsync/sync.py", line 1509, in main
sync: Sync = Sync(
File "/usr/local/lib/python3.10/site-packages/pgsync/singleton.py", line 36, in __call__
cls._instances[key] = super(Singleton, cls).__call__(
File "/usr/local/lib/python3.10/site-packages/pgsync/sync.py", line 107, in __init__
self.create_setting()
File "/usr/local/lib/python3.10/site-packages/pgsync/sync.py", line 255, in create_setting
self.search_client._create_setting(
File "/usr/local/lib/python3.10/site-packages/pgsync/search_client.py", line 284, in _create_setting
mapping = self._build_mapping(tree, routing)
File "/usr/local/lib/python3.10/site-packages/pgsync/search_client.py", line 331, in _build_mapping
raise RuntimeError(
RuntimeError: Invalid Elasticsearch mapping parameter contexts
This also doesn't work:
"title__suggest": {
"type": "completion",
"fields": {
"contexts": [
{
"name": "user",
"type": "category",
"path": "user_id"
}
]
}
}
Hi any update on this?
Hi @toluaina , not hurrying anything, just want to understand if this is known limitation and whether this could be resolved soon or not? if not then we have to make some customization to support this behaviour, thanks.
- can you please provide the full mapping or your schema.json
- Also what version of ES or OS are you using?
- This is the current list of known mapping.
- Full Schema:
[
{
"database": "my_db",
"index": "search-index",
"nodes": {
"table": "services",
"schema": "public",
"transform": {
"mapping": {
"created_at": {
"type": "date"
},
"created_by": {
"type": "long"
},
"deleted_by": {
"type": "long"
},
"description": {
"type": "text"
},
"email": {
"type": "keyword"
},
"end_date": {
"type": "date"
},
"experience_years": {
"type": "float"
},
"id": {
"type": "long"
},
"is_deleted": {
"type": "boolean"
},
"job_location_type": {
"type": "keyword"
},
"service_category": {
"type": "keyword"
},
"status": {
"type": "keyword"
},
"title": {
"type": "text"
},
"updated_at": {
"type": "date"
},
"updated_by": {
"type": "long"
},
"user_id": {
"type": "long"
},
"rating": {
"type": "float"
},
"title__suggest": {
"type": "completion"
},
"description__suggest": {
"type": "completion"
},
"job_location_type__suggest": {
"type": "completion"
},
"service_category__suggest": {
"type": "completion"
},
"users_name__suggest": {
"type": "completion"
},
"company_type__suggest": {
"type": "completion"
},
"company_name__suggest": {
"type": "completion"
},
"designation__suggest": {
"type": "completion"
},
"service_tags__suggest": {
"type": "completion"
},
"service_skills__suggest": {
"type": "completion"
}
}
}
}
}
]
- ES Docker version: 8.15.2
- And i want to use context with completion suggester
cc @toluaina
hi @toluaina just following up here
hi @toluaina any update here?
hi @toluaina any update here?