File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66require_relative './client_initialization'
77
8+ # Delete the collection if it already exists
9+ begin
10+ @typesense . collections [ 'companies' ] . delete
11+ rescue Typesense ::Error ::ObjectNotFound
12+ end
13+
814##
915# Create a collection
1016schema = {
6167##
6268# Create overrides
6369
64- @typesense . collections [ 'companies' ] . overrides . create (
65- "id" : 'promote-doofenshmirtz' ,
70+ @typesense . collections [ 'companies' ] . overrides . upsert (
71+ 'promote-doofenshmirtz' ,
6672 "rule" : {
6773 "query" : 'doofen' ,
6874 "match" : 'exact'
6975 } ,
7076 "includes" : [ { 'id' => '126' , 'position' => 1 } ]
7177)
72- @typesense . collections [ 'companies' ] . overrides . create (
73- "id" : 'promote-acme' ,
78+ @typesense . collections [ 'companies' ] . overrides . upsert (
79+ 'promote-acme' ,
7480 "rule" : {
7581 "query" : 'stark' ,
7682 "match" : 'exact'
You can’t perform that action at this time.
0 commit comments