Search code examples
c#indexingazure-cognitive-search

Azure Search Index C# SDK


I'm new to Azure Search SDK, and currently within c# I can create a Blob Storage, Create and Index, DataSource and Indexer

But I'm looking for some advice on how to best create an index that allows me to search on key details from an existing database record and the contents of documents (word/pdf etc) held against the record.

So for example I want to search for people with a given status who have certain keywords within the (word/pdf etc) document stored with the user.

Is it best to add the required addition search fields in the metadata of the document and the search the blob storage. Or is there another way or better way to do this

Thanks


Solution

  • You can populate the same search index from a variety of data sources. So you can use both Azure SQL datasource and a blob datasource (and even push additional data using indexing API yourself, if needed). You just need to ensure that both data sources agree on what the document key is.

    In your case, it looks most of your data lives in a (Azure SQL?) database, with rows pointing to blobs with some additional data that you want to get indexed. You can create two datasource/indexer pairs - one for DB, one for blobs - both writing to the same search index. Just make sure that both "pipelines" agree on the document key in the search index, so they both update the same search documents.

    Hope i didn't misunderstand your question!