Join Chander Dhall for an in-depth discussion in this video Creating a search service, part of Azure Search for Developers.
- [Instructor] Now we'll navigate to portal.azure.com and then create our Azure search instance. Press create. Now one thing to keep in mind is that the name you give here has to be lower case. Then select your subscription then the resource group. We're going to call that Cazton RG. Location is west US and now you can choose from different kinds of offerings.
You also have a free offering. So if you were to play with it and all you need is few indexes, you can come here and pick this and this is just three indexes, so there's pretty much no way you'll be able to use this in production, but it gives you a good way to play with this. You can also go for a basic one which can take up to a million documents as long as the storage is about two gigabytes and it goes all the way to about one thousand indexes per partition and then you can have about 200 million documents per partition, so that's a lot.
We're going to go ahead and pick the standard option and say select and once you select that we're going to pin to dashboard and say create. So as you can see the deployment succeeded and the next thing we can do is say import data. So the existing data sources that are supported are the same five ones that we talked about and then they also have some sample data and this is good in case you are just beginning to play with Azure search it might be a great idea to take some of these samples.
So since we don't need this, we're going to get rid of this and then we can also add an index through the portal. We can call it test and we can go click fields created. Let's create a property name and it's of type string and then I can say it's filterable and it's facetable and it's searchable and it's also sortable. It can't be the key as you notice because I already have a key so this just wouldn't allow me to make it a key and then of course I want it to be retrievable.
So that's interesting because you can start creating your fields right here, but again, it's always better to do this programmatically. So we'll go ahead and press okay and create our index test, but we're not going to end up using this. What we're looking for though is going to be our key. So as you can see you have a primary admin key and I can always generate my primary key and secondary key. The reason we have two is because we can use one in production and then when we're swapping the key, we can use the key we have and then regenerate our secondary while we use our primary and then regenerate the primary later, so it makes it easy for you to swap it and then you can also manage your query keys which are right here and this key will allow us to only be able to read from that particular index or pretty much any which is in this cazton search service instance that we just created except that we won't be able to delete, or update, or create any indexes.
Here's a simple chart that you can always refer. It talks about string. As you can see string pretty much supports everything and then you can see collection of strings, it cannot be a key, which makes sense because you don't want a collection to be a key, and it's not sortable and you can have an integer, well quite surprisingly nothing else could be a key so your key has to be a string, that's just by default. So you'll see all the no's over there and when it comes to searchable it's only string and collection of string as we talked about earlier that are going to be searchable.
By default every single key could be filterable, so you could technically make any kind of key filterable and when it comes to suggestions, again, it will only be working for strings and the collection of strings and that makes sense because when you're doing a type ahead you're not going to be able to do a type ahead for integers or other kinds of numbers or even latitudes and other things.
- Querying and indexing
- Creating a search service
- Using APIs during searching
- Importing JSON data
- Handling synonyms
- Working with suggestors and facets