Forum Discussion
New to Azure search and got some questions
We are using Azure cognitive search to search through profiles and have come up with some questions:
- When updating a synonym map, we are deleting it and re-creating it. However, when we try to re-set the fields that synonym map applies to, it says they are already attached. If we deleted the synonym map, wouldn't those connections have gone away. If not, do we need to re-update the fields? Is there a way to "detach" the map from the fields before deleting it, and then re-creating it?
- Are there additional sdk sample applications that do more than just the bare bones of Azure cognitive search, and include best practices? This would include creating indexes, adding scoring profiles, synonym maps, etc.
- Are there SDK functions that allow for "re-setting" and "re-indexing" of data stores, after being refreshed? We found the way to call them via rest calls, but this requires creating httpRequestMessages with all the parameters, etc, and then gettingthe response. It would be nice if there were just sdk objects/functions available.
Thank you
- DerekLegenzoffMicrosoft
Synonym Maps
When a synonym map is deleted but a field still references it, search queries against that field will fail with Http Status 400, Bad Request. When you recreate the synonym map, you don't need to update the field configuration.
Samples
We generally try to bake in as many best practices into samples as we can. One great starting point is the Knowledge Mining solution accelerator. We also have a new sample showing how to integrate QnA with Azure Cognitive Search that includes a React Template. We also try to publish the code for a lot of our demos such as the COVID search app.
Resetting Indexer
This should be possible. Take a look at this doc (in particular ResetIndexer and RunIndexer).
- Michael51Copper Contributor
If deleting the map would cause any searches to fail, is there a way to remove maps from search fields?
- DerekLegenzoffMicrosoft
Michael51 yes, you can update the index to remove the synonym map from the field. In the case of the REST API, you would just set the synonym map attribute to an empty list ("synonymMaps": [])