Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid parameter contexts in Completion suggest #591

Open
abhishek72850 opened this issue Feb 19, 2025 · 2 comments
Open

Invalid parameter contexts in Completion suggest #591

abhishek72850 opened this issue Feb 19, 2025 · 2 comments

Comments

@abhishek72850
Copy link

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
@abhishek72850
Copy link
Author

This also doesn't work:

"title__suggest": {
      "type": "completion",
      "fields": {
          "contexts": [
              {
                  "name": "user",
                  "type": "category",
                  "path": "user_id"
              }
          ]
      }
  }

@abhishek72850 abhishek72850 changed the title Inavlid parameter contexts in Completion suggest Invalid parameter contexts in Completion suggest Feb 20, 2025
@abhishek72850
Copy link
Author

Hi any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant