Field Definition: The schema should define fields that reflect the most important elements of the invoice that users may want to search or filter on, such as invoice ID, invoice date, buyer and supplier information, invoice totals, etc.
Data Types: Assign the appropriate data types to each field, such as Edm.String for textual data, Edm.DateTimeOffset for date and time, and Edm.Double for numeric values.
Searchable Fields: Determine which fields should be searchable. For example, invoice ID, buyer/supplier names, and article descriptions might be commonly searched fields.
Filterable and Sortable Fields: Decide which fields should be filterable and sortable, such as date, total amount, and buyer/supplier identifiers.
Facetable Fields: Fields that may be useful for faceting (aggregating data), such as payment terms, VAT information, and currency codes.
Complex Types: Invoices often have repeating elements, like invoice lines. Azure Cognitive Search supports complex types, which allow you to index collections of complex objects.
Collection Fields: For repeating elements like invoice lines, you might want to use a collection field that contains complex objects.
Considerations: