Created
November 3, 2021 14:09
-
-
Save gkielwasser/d2758d2186c7c2ea16a1fdbac273843f to your computer and use it in GitHub Desktop.
Typesense - duplicated field in schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client.aliases().upsert('warehouses', { | |
| 'collection_name': 'dev-warehouses-v1.0.1-d' | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client.collections().create({ | |
| version: 'v1.0.1-d', | |
| alias: 'warehouses', | |
| name: 'dev-warehouses-v1.0.1-d', | |
| fields: [ | |
| { name: 'id', type: 'string', facet: false }, | |
| { name: 'name', type: 'string', facet: false }, | |
| { name: 'location.geometry', type: 'geopoint', facet: false }, | |
| { | |
| name: 'location.address.canton.id', | |
| type: 'string', | |
| facet: false | |
| }, | |
| { | |
| name: 'location.address.canton.translations.fr-CH.translation', | |
| type: 'string', | |
| facet: true | |
| }, | |
| { | |
| name: 'location.address.canton.translations.de-DE.translation', | |
| type: 'string', | |
| facet: true | |
| }, | |
| { | |
| name: 'location.address.canton.translations.it-IT.translation', | |
| type: 'string', | |
| facet: true | |
| }, | |
| { | |
| name: 'location.address.canton.translations.en-US.translation', | |
| type: 'string', | |
| facet: true | |
| }, | |
| { | |
| name: 'craftsman.super_craftsman', | |
| type: 'bool', | |
| optional: true, | |
| facet: true | |
| }, | |
| { | |
| name: 'craftsman.production_labels.*.*', | |
| type: 'string[]', | |
| optional: true, | |
| facet: true | |
| }, | |
| { | |
| name: 'date_updated', | |
| type: 'int64', | |
| facet: false, | |
| _type: 'date' | |
| } | |
| ] | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client.collections('warehouses').documents().upsert({ | |
| id: 'cf84f59d-c6a7-4160-ba57-f5aa2f11e03a', | |
| name: 'Hof Baumgarten', | |
| 'location.geometry': [ 47.4823896, 7.6416678 ], | |
| 'location.address.canton.id': '6f4bf1c2-c411-44fc-8800-f5fa990b9f8d', | |
| 'location.address.canton.translations.fr-CH.translation': 'Soleure', | |
| 'location.address.canton.translations.de-DE.translation': 'Solothurn', | |
| 'location.address.canton.translations.it-IT.translation': 'Soletta', | |
| 'location.address.canton.translations.en-US.translation': 'Solothurn', | |
| 'craftsman.super_craftsman': false, | |
| 'craftsman.production_labels.*.*': [ 'Natura-Veal' ], | |
| date_updated: 1635948200 | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The correct sequence is: