Reputation: 3427
This one is for the MS Azure Search team, unless someone else has run into this and found a resolution for it.
I'm creating an index which is importing data from a SQL Server Database. I would like to add a field to the index whose value is just "OK" for every document. This field does not exist in the database and we do not want to add it there.
Is it possible to add a hard-coded field to an Azure Search index which auto-populates with the given string (in this case, "OK") for all documents that get imported?
Upvotes: 0
Views: 395
Reputation: 4671
Injecting constant values isn't currently possible with indexers - you would need to add this to the table, or create a SQL query that SELECTs that value, and use that query as your Azure Search datasource.
However, we've seen several customers ask for this, so please vote for this suggestion: Provide field mapping function to inject a constant value into the index. Thanks!
Upvotes: 1