Dynamic custom fields with numeric and date range queries

We have a requirement to support custom search fields for our users. Each user should have an ability to create their own fields which can than be searched through by using our built-in filtering mechanism

Our initial idea was to store each custom field as an object in an array stored in flattened type property of the document. That way we would define an object that has type, key and value and use standard filter operators.
The problem arises when we want to have number and date fields and filter on them, because flattened type doesn't support all the query operators and it doesn't seem to behave as we would expect it to. Is there a way we can use range queries properly on number and date fields of flattened property?
Is there perhaps another way we could get the desired functionality of each customer being able to define custom fields and filter on them?

One idea was having a separate index per customer, but we would like to avoid that.
Another is using the old nested type property, however that increases index size significantly.

Ideally we want to support operations like greater than, lower than and between on number and date fields, and starts with, ends with and contains on string fields.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.