Accelerate search index development with Visual Studio Code

Published Feb 10 2021 12:57 PM 3,553 Views
Microsoft

 

Azure Cognitive Search provides developers with APIs and tools to make it easy to add a great search experience to your application. There are tools available in the portal to import data into a search index and SDKs to simplify the integration of search functionality into your code base.

 

However, sometimes you need something in between: simpler than code, but more powerful than the portal. In these cases, it’s common to interact directly with the REST APIs to quickly update an indexer, add a document, or perform other standard tasks. Tools like Postman are great for this but building out API calls from scratch can quickly become tedious. You wouldn’t write an API call from scratch to add a document to Azure Storage—you’d use Azure Storage Explorer—and we don’t want you to have to do that for search either.

 

With this in mind, we created the Visual Studio Code Extension for Azure Cognitive Search (Preview). The Visual Studio Code extension makes it easy to work with your search service using the full capabilities of the REST APIs while providing rich IntelliSense and snippets to help you. With the extension, you can create and update indexes and other components, add documents, search, and more. You’ll never need to struggle with remembering the correct syntax again.

 

Extension Functionality

The extension covers all the major REST API operations for Cognitive Search. Check out the examples below to see some of what’s possible and feel free to request additional functionality here.

 

Browse all your Azure Cognitive Search services

Get access to all your search services in one place. You can quickly see all your indexes, indexers, and other components.

overview.png

 

Create new indexes, indexers, data sources, skillsets, and synonym maps

You can create a new index or other component just by editing the JSON and saving the file. You can then read, update, or delete these components at any time.

create-index.gif

 

Take advantage of rich IntelliSense

The extension also includes IntelliSense to guide you as you’re building out your JSON. Instead of referencing external docs each time, you can see what parameters exist and what their allowed values are as you type.

intellisense.gif

In addition to IntelliSense, the extension provides snippets or templates for building more complex objects, such as data sources and skillsets, so that you have a good starting point.

 

Add or update documents in the search index

Adding or updating documents is something that’s not possible in the portal today. With the extension, you can quickly add a document, and it will even save you some time by creating a JSON template for you based on your index definition.

 

create-document-2.png

You can view or update existing documents too.

 

Query your search indexes

Finally, once you’ve added documents to your search service, you can also query from within the extension and view the results side by side. You can even add multiple queries or save the queries to a file to refer to them later.

all-searches.png

 

Key use cases

If your security requirements mandate the use of Private Endpoints or IP Firewalls, you’ll find that some functionality is no longer available in the portal. For these cases, the extension is a great alternative to the portal for interacting with your indexes and the other components of your search service.

 

In other cases, if you find yourself constantly recreating indexes or making small tweaks to them or other search components, the extension can make it incredibly easy to make small updates such as adding a field to an index.

 

Get Started

Regardless of how you’re trying to use Cognitive Search, this extension will likely make your life easier. To get started today, download the extension, and follow the related quickstart. You’ll see just how quickly and easily you can get up and running with Cognitive Search using the Visual Studio Code Extension.

 

If you run into any issues or have any questions, please feel free to reach out to us at azuresearch_contact@microsoft.com or raise an issue on the extension’s GitHub repo.

 

 
 
 
 
 
Co-Authors
Version history
Last update:
‎Feb 10 2021 01:34 PM
Updated by: