Help in defining a schema


I have 15-20 fields in my elastic search document using which a user can filter data to fetch relevant documents. These filters are of type string.

All these filters are not defined for all the documents. In the current implementation I assign a value of 'U' to unused filters and valid values to relevant filters. During search we match all the filters. Filters not specified are matched against 'U'. For some of the filters we have a predefined set of values like gender can be Male (M), Female (F), Undefined (U).

Please suggest best way to define these filters. Would it be better to use integer values like 1, 2 etc instead of strings. Will it improve performance.


Just use what you have, the bitsets that the filters create will not be improved by using numbers.