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

Add ability to specify locale when creating a schema #120

Closed
keith555 opened this issue Jul 7, 2022 · 4 comments
Closed

Add ability to specify locale when creating a schema #120

keith555 opened this issue Jul 7, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@keith555
Copy link

keith555 commented Jul 7, 2022

I can assign a locale to a schema field using the API directly, like this

	 curl "http://localhost:8108/collections" \
       -X POST \
       -H "Content-Type: application/json" \
       -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
       -d '{
         "name": "english_thai",
         "fields": [
          {"name": "english", "type": "string" },
          {"name": "thai", "type": "string", "locale": "th" }
         ],
         "default_sorting_field": "num_employees"
       }'

I can't find an equivalent way to specify locale using the dart client.

@keith555 keith555 added the enhancement New feature or request label Jul 7, 2022
@happy-san
Copy link
Collaborator

Hi @keith555
I've just committed code that makes 2.17.0 as the mininum dart SDK version. I can add this field, just wanted to confirm if you can match this constraint. If not I can revert this and push your request first.

@keith555
Copy link
Author

keith555 commented Jul 7, 2022

2.17.0 is fine. Thanks a lot for your quick response.

@happy-san
Copy link
Collaborator

Hi @keith555
Could you check out this branch?
https://github.com/happy-san/typesense-dart/blob/chores/lib/src/models/field.dart

There are some breaking changes to the models to support the v0.23.0 Typsense. I hope that's acceptable.

@keith555
Copy link
Author

That seems to be working now. Thanks a lot for your speedy help.

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

No branches or pull requests

2 participants