First I want to say that the concept of a dedicated search engine is all new to me, so please be indulgent :-)
How does a transactional database entity with an Id and a Name does translate into an Azure Search Index field ?
Should we add only Name
, or both Id
and Name
?
For example, let's say I want the Client in my index. I want both to search and have facets on Client.
Should I add only ClientName
into the index ?
What if ClientName
is renammed ?
What if ClientName
is not unique ?
Should I add both fields into the index and have:
ClientName
: SearchableClientId
: Facetable, Filterable
I understand having ClientId Facetable (instead of ClientName) will make it more work to show the facets since i'll have to fetch myself the names corresponding the the ClientId returned by Azure Search.
Also, having the ClientId
Filterable, I assume it would allow me to perform a batch rename of ClientName
.
Is my reasoning ok ?
Is there any best practices / guidelines ?
EDIT
Here is a more concrete example.
Let say that in the transactional db, we have tables with Id
and Name
for Format
, Location
, Author
, Genre
, Region
, ...
If we were to build those facets in Azure Search, would the recommended approach be to add both the Id
and Name
for each of them, and set the Id
field as Facetable ?