Skip to content

Invalid parameter contexts in Completion suggest #591

@abhishek72850

Description

@abhishek72850

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions