|
| 1 | +To run the examples on this page, you will need to create three indexes. |
| 2 | + |
| 3 | +To create the indexes, you can use: |
| 4 | + |
| 5 | +* The index editor built into the web console. |
| 6 | +* The REST API |
| 7 | +* The command line utility. |
| 8 | +
|
| 9 | +For this exercise, the easiest way is to use the web console to import the index definitions below. |
| 10 | + |
| 11 | +If you need more information on creating search indexes using Couchbase Web UI, see xref:search:create-search-index-ui.adoc[] |
| 12 | + |
| 13 | + |
| 14 | +[tabs] |
| 15 | +==== |
| 16 | +travel-sample-index-unstored:: |
| 17 | ++ |
| 18 | +-- |
| 19 | +[source,json] |
| 20 | +---- |
| 21 | +
|
| 22 | +{ |
| 23 | + "name": "travel-sample-index-unstored", |
| 24 | + "type": "fulltext-index", |
| 25 | + "params": { |
| 26 | + "doc_config": { |
| 27 | + "docid_prefix_delim": "", |
| 28 | + "docid_regexp": "", |
| 29 | + "mode": "type_field", |
| 30 | + "type_field": "type" |
| 31 | + }, |
| 32 | + "mapping": { |
| 33 | + "analysis": { |
| 34 | + "analyzers": { |
| 35 | + "singleAnalyzer": { |
| 36 | + "tokenizer": "single", |
| 37 | + "type": "custom" |
| 38 | + } |
| 39 | + } |
| 40 | + }, |
| 41 | + "default_analyzer": "standard", |
| 42 | + "default_datetime_parser": "dateTimeOptional", |
| 43 | + "default_field": "_all", |
| 44 | + "default_mapping": { |
| 45 | + "dynamic": true, |
| 46 | + "enabled": true |
| 47 | + }, |
| 48 | + "default_type": "_default", |
| 49 | + "docvalues_dynamic": false, |
| 50 | + "index_dynamic": true, |
| 51 | + "store_dynamic": false, |
| 52 | + "type_field": "_type" |
| 53 | + }, |
| 54 | + "store": { |
| 55 | + "indexType": "scorch", |
| 56 | + "segmentVersion": 15 |
| 57 | + } |
| 58 | + }, |
| 59 | + "sourceType": "gocbcore", |
| 60 | + "sourceName": "travel-sample", |
| 61 | + "sourceUUID": "94387e8a4cefe4abeb51d92e28a696c6", |
| 62 | + "sourceParams": {}, |
| 63 | + "planParams": { |
| 64 | + "maxPartitionsPerPIndex": 1024, |
| 65 | + "indexPartitions": 1, |
| 66 | + "numReplicas": 0 |
| 67 | + }, |
| 68 | + "uuid": "5e26bbd6c2c87069" |
| 69 | +} |
| 70 | +---- |
| 71 | +-- |
| 72 | +
|
| 73 | +travel-sample-index-stored:: |
| 74 | ++ |
| 75 | +-- |
| 76 | +[source,json] |
| 77 | +---- |
| 78 | +{ |
| 79 | + "name": "travel-sample-index-stored", |
| 80 | + "type": "fulltext-index", |
| 81 | + "params": { |
| 82 | + "doc_config": { |
| 83 | + "docid_prefix_delim": "", |
| 84 | + "docid_regexp": "", |
| 85 | + "mode": "type_field", |
| 86 | + "type_field": "type" |
| 87 | + }, |
| 88 | + "mapping": { |
| 89 | + "analysis": { |
| 90 | + "analyzers": { |
| 91 | + "letterAnalyzer": { |
| 92 | + "tokenizer": "letter", |
| 93 | + "type": "custom" |
| 94 | + } |
| 95 | + } |
| 96 | + }, |
| 97 | + "default_analyzer": "standard", |
| 98 | + "default_datetime_parser": "dateTimeOptional", |
| 99 | + "default_field": "_all", |
| 100 | + "default_mapping": { |
| 101 | + "dynamic": true, |
| 102 | + "enabled": true |
| 103 | + }, |
| 104 | + "default_type": "_default", |
| 105 | + "docvalues_dynamic": false, |
| 106 | + "index_dynamic": true, |
| 107 | + "store_dynamic": true, |
| 108 | + "type_field": "_type" |
| 109 | + }, |
| 110 | + "store": { |
| 111 | + "indexType": "scorch", |
| 112 | + "segmentVersion": 15 |
| 113 | + } |
| 114 | + }, |
| 115 | + "sourceType": "gocbcore", |
| 116 | + "sourceName": "travel-sample", |
| 117 | + "sourceUUID": "94387e8a4cefe4abeb51d92e28a696c6", |
| 118 | + "sourceParams": {}, |
| 119 | + "planParams": { |
| 120 | + "maxPartitionsPerPIndex": 1024, |
| 121 | + "indexPartitions": 1, |
| 122 | + "numReplicas": 0 |
| 123 | + }, |
| 124 | + "uuid": "16d6602d3193b526" |
| 125 | +} |
| 126 | +---- |
| 127 | +
|
| 128 | +-- |
| 129 | +
|
| 130 | +geoIndex:: |
| 131 | ++ |
| 132 | +-- |
| 133 | +
|
| 134 | +[source,json] |
| 135 | +---- |
| 136 | +
|
| 137 | +{ |
| 138 | + "name": "geoIndex", |
| 139 | + "type": "fulltext-index", |
| 140 | + "params": { |
| 141 | + "doc_config": { |
| 142 | + "docid_prefix_delim": "", |
| 143 | + "docid_regexp": "", |
| 144 | + "mode": "type_field", |
| 145 | + "type_field": "type" |
| 146 | + }, |
| 147 | + "mapping": { |
| 148 | + "default_analyzer": "standard", |
| 149 | + "default_datetime_parser": "dateTimeOptional", |
| 150 | + "default_field": "_all", |
| 151 | + "default_mapping": { |
| 152 | + "dynamic": true, |
| 153 | + "enabled": true, |
| 154 | + "properties": { |
| 155 | + "geo": { |
| 156 | + "enabled": true, |
| 157 | + "dynamic": false, |
| 158 | + "fields": [ |
| 159 | + { |
| 160 | + "include_in_all": true, |
| 161 | + "index": true, |
| 162 | + "name": "geo", |
| 163 | + "store": true, |
| 164 | + "type": "geopoint" |
| 165 | + } |
| 166 | + ] |
| 167 | + } |
| 168 | + } |
| 169 | + }, |
| 170 | + "default_type": "_default", |
| 171 | + "docvalues_dynamic": false, |
| 172 | + "index_dynamic": true, |
| 173 | + "store_dynamic": false, |
| 174 | + "type_field": "_type" |
| 175 | + }, |
| 176 | + "store": { |
| 177 | + "indexType": "scorch", |
| 178 | + "segmentVersion": 15, |
| 179 | + "spatialPlugin": "s2" |
| 180 | + } |
| 181 | + }, |
| 182 | + "sourceType": "gocbcore", |
| 183 | + "sourceName": "travel-sample", |
| 184 | + "sourceUUID": "94387e8a4cefe4abeb51d92e28a696c6", |
| 185 | + "sourceParams": {}, |
| 186 | + "planParams": { |
| 187 | + "maxPartitionsPerPIndex": 1024, |
| 188 | + "indexPartitions": 1, |
| 189 | + "numReplicas": 0 |
| 190 | + }, |
| 191 | + "uuid": "445bceb9301d0d74" |
| 192 | +} |
| 193 | +---- |
| 194 | +
|
| 195 | +
|
| 196 | +-- |
| 197 | +
|
| 198 | +
|
| 199 | +==== |
0 commit comments