I have a blob storage that contains some xml-files. I want to use the power of Azure Search to easily find documents in this blob storage. The structure of the XML-files are in this format:
<items>
<item>
<id>12345</id>
<text>This is an example</text>
<item>
<item>
<id>12346</id>
<text>This is an example</text>
<item>
</items>
Creating an index in Azure Search fails because the index requires marking a field as IsKey
at the top level, but I don't have such a field. How can I solve this? Underneath is the code to generate an index for ComplexTypes:
var complexField = new ComplexField("items");
complexField.Fields.Add(new SearchableField("id") { IsKey = true, IsFilterable = true, IsSortable = true });
complexField.Fields.Add(new SearchableField("text") { IsFilterable = true, IsSortable = true });
var index = new SearchIndex(IndexName)
{
Fields =
{
complexField
}
};
Can anyone guide me in the correct direction?