vscode-azurecognitivesearch/snippets/index-snippets.json

176 строки
4.3 KiB
JSON

{
"Index": {
"prefix": "azs-index",
"body": [
"{",
"\t\"name\": \"my-index\",",
"\t\"fields\": [",
"\t {",
"\t\t\"name\": \"id\",",
"\t\t\"type\": \"Edm.String\",",
"\t\t\"key\": true,",
"\t\t\"searchable\": true,",
"\t\t\"filterable\": false,",
"\t\t\"facetable\": false,",
"\t\t\"sortable\": true",
"\t },",
"\t {",
"\t\t\"name\": \"text\",",
"\t\t\"type\": \"Edm.String\",",
"\t\t\"searchable\": true,",
"\t\t\"filterable\": false,",
"\t\t\"facetable\": false,",
"\t\t\"sortable\": false",
"\t }",
"\t]",
"}"
],
"description": "Creates an index"
},
"Upload Data": {
"prefix": "azs-upload-data",
"body": [
"{",
"\t\"value\": [",
"\t\t{",
"\t\t\t\"@search.action\": \"upload\",",
"\t\t\t\"id\": \"1\",",
"\t\t\t\"text\": \"Let's get this into a search index!\"",
"\t\t},",
"\t\t{",
"\t\t\t\"@search.action\": \"upload\",",
"\t\t\t\"id\": \"2\",",
"\t\t\t\"text\": \"Index me please\"",
"\t\t}",
"\t]",
"}"
],
"description": "Indexes data via the Push API"
},
"Custom analyzer": {
"prefix": "azs-analyzer",
"body": [
"\"analyzers\": [",
"\t{",
"\t\t\"name\": \"my_analyzer\",",
"\t\t\"@odata.type\": \"#Microsoft.Azure.Search.CustomAnalyzer\",",
"\t\t\"charFilters\": [",
"\t\t\t\"map_dash\",",
"\t\t\t\"remove_whitespace\"",
"\t\t],",
"\t\t\"tokenizer\": \"my_standard_tokenizer\",",
"\t\t\"tokenFilters\": [",
"\t\t\t\"my_asciifolding\",",
"\t\t\t\"lowercase\"",
"\t\t]",
"\t}",
"],",
"\"charFilters\": [",
"\t{",
"\t\t\"name\": \"map_dash\",",
"\t\t\"@odata.type\": \"#Microsoft.Azure.Search.MappingCharFilter\",",
"\t\t\"mappings\": [\"-=>_\"]",
"\t},",
"\t{",
"\t\t\"name\": \"remove_whitespace\",",
"\t\t\"@odata.type\": \"#Microsoft.Azure.Search.MappingCharFilter\",",
"\t\t\"mappings\": [\"\\\\\\u0020=>\"]",
"\t}",
"],",
"\"tokenizers\": [",
"\t{",
"\t\t\"name\": \"my_standard_tokenizer\",",
"\t\t\"@odata.type\": \"#Microsoft.Azure.Search.StandardTokenizerV2\",",
"\t\t\"maxTokenLength\": 20",
"\t}",
"],",
"\"tokenFilters\": [",
"\t{",
"\t\t\"name\": \"my_asciifolding\",",
"\t\t\"@odata.type\": \"#Microsoft.Azure.Search.AsciiFoldingTokenFilter\",",
"\t\t\"preserveOriginal\": true",
"\t}",
"]"
],
"description": "Creates the components for adding a custom analyzer to an index"
},
"Field": {
"prefix": "azs-field",
"body": [
"{",
"\t\"name\": \"Name\",",
"\t\"type\": \"Edm.String\",",
"\t\"searchable\": true,",
"\t\"filterable\": false,",
"\t\"facetable\": false,",
"\t\"sortable\": false",
"}"
],
"description": "Adds a basic field to an index"
},
"Complex field": {
"prefix": "azs-field-complex",
"body": [
"{",
"\t\"name\": \"Address\",",
"\t\"type\": \"Edm.ComplexType\",",
"\t\"fields\": [",
"\t\t{",
"\t\t\t\"name\": \"StreetAddress\",",
"\t\t\t\"type\": \"Edm.String\",",
"\t\t\t\"filterable\": false,",
"\t\t\t\"sortable\": false,",
"\t\t\t\"facetable\": false,",
"\t\t\t\"searchable\": true",
"\t\t},",
"\t\t{",
"\t\t\t\"name\": \"City\",",
"\t\t\t\"type\": \"Edm.String\",",
"\t\t\t\"searchable\": true,",
"\t\t\t\"filterable\": true,",
"\t\t\t\"sortable\": true,",
"\t\t\t\"facetable\": true",
"\t\t},",
"\t\t{",
"\t\t\t\"name\": \"StateProvince\",",
"\t\t\t\"type\": \"Edm.String\",",
"\t\t\t\"searchable\": true,",
"\t\t\t\"filterable\": true,",
"\t\t\t\"sortable\": true,",
"\t\t\t\"facetable\": true",
"\t\t}",
"\t]",
"}"
],
"description": "Adds a complex field to an index"
},
"Scoring profile": {
"prefix": "azs-scoring-profile",
"body": [
"\"scoringProfiles\": [",
" {",
"\t\"name\": \"geo\",",
"\t\"text\": {",
"\t \"weights\": {",
"\t\t\"hotelName\": 5",
"\t }",
"\t},",
"\t\"functions\": [",
"\t {",
"\t\t\"type\": \"distance\",",
"\t\t\"boost\": 5,",
"\t\t\"fieldName\": \"location\",",
"\t\t\"interpolation\": \"logarithmic\",",
"\t\t\"distance\": {",
"\t\t \"referencePointParameter\": \"currentLocation\",",
"\t\t \"boostingDistance\": 10",
"\t\t}",
"\t }",
"\t]",
" }",
"]"
],
"description": "Adds a scoring profile to an index"
}
}