Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kevin-Bronsdijk/9e80af3c2b64efc6f1a8 to your computer and use it in GitHub Desktop.
Save Kevin-Bronsdijk/9e80af3c2b64efc6f1a8 to your computer and use it in GitHub Desktop.
azure-search-indexers-index-data-without-writing-code
CREATE VIEW [SalesLT].[vProductAndDescriptionIndex]
WITH SCHEMABINDING
AS
-- View (indexed or standard) to display products and product descriptions by language.
SELECT
p.[ProductID] as [id]
,p.[Name]
,pm.[Name] AS [ProductModel]
,pmx.[Culture]
,pd.[Description]
FROM [SalesLT].[Product] p
INNER JOIN [SalesLT].[ProductModel] pm
ON p.[ProductModelID] = pm.[ProductModelID]
INNER JOIN [SalesLT].[ProductModelProductDescription] pmx
ON pm.[ProductModelID] = pmx.[ProductModelID]
INNER JOIN [SalesLT].[ProductDescription] pd
ON pmx.[ProductDescriptionID] = pd.[ProductDescriptionID];
GO
{
"name" : "datasource1",
"type" : "azuresql",
"credentials" : { "connectionString" : "Server=tcp:azuresearchindexer.database.windows.net,1433;Database=AzureSearchIndexer;User ID=XYZ;XYZ @A;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" },
"container" : { "name" : "[SalesLT].[vProductAndDescriptionIndex] " }
}
{
"name" : "indexer1",
"dataSourceName" : "datasource1",
"targetIndexName" : "index1"
}
"value": [
{
"@search.score": 1.3257511,
"id": "858",
"Name": "Half-Finger Gloves, S"
},
{
"@search.score": 1.3257511,
"id": "859",
"Name": "Half-Finger Gloves, M"
},
{
"@search.score": 1.3257511,
"id": "860",
"Name": "Half-Finger Gloves, L"
},
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment