SDKits / ExamineX

Issue tracker for ExamineX
https://examinex.online
5 stars 0 forks source link

Custom fieldType Definition for StringCollection that is Filterable #78

Closed shgreig-mtm closed 9 months ago

shgreig-mtm commented 1 year ago

Hello,

Trying to understand from the docs how to create the field definition of a field to be a StringCollection that is filterable, any advise?

Shazwazza commented 1 year ago

Hi,

Probably the easiest way for now for a filterable string field, would be to handle the CreatingOrUpdatingIndex event and modifying that field there.

We'll update the APIs to make this easier/clearer though so you would be able to do it without the event and instead by configuring IOptions for that field.

Also, I've updated the docs to reflect how v3/v4 works with more examples: https://examinex.online/customization.

shgreig-mtm commented 1 year ago

Thank you, I'll give it a go tomorrow

Shazwazza commented 1 year ago

Just to follow up on this, I don't think that AzureSearch allows filtering on StringCollection: https://learn.microsoft.com/en-us/azure/search/search-query-understand-collection-filters#why-collection-filters-are-limited

AzureSearch by default applies the filterable option to these data types:

SearchFieldDataType.DateTimeOffset: SearchFieldDataType.Double: SearchFieldDataType.GeographyPoint: SearchFieldDataType.Int32: SearchFieldDataType.Int64: SearchFieldDataType.String:

But you could try using the event and see what happens.