RediSearch / redisearch-py

RediSearch python client

Home Page:https://redisearch.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sortable option missing for Tag fields

dmaier-redislabs opened this issue · comments

The following didn't work because a TagField doesn't implement the option 'SORTABLE'.


client.create_index((TagField('sku'), TextField('name'), TextField('desc'), NumericField('price', sortable=True), TagField('category', sortable=True)), definition=definition)

However, the documentation is stating that sortable should be supported with tag fields and it is especially beneficial to have sortable tag fields when working with aggregations.

I used the following workaround/hack for now:

ctgField = TagField('category')
ctgFieldParams = list(ctgField.args)
ctgFieldParams.append('SORTABLE')
ctgField.args = tuple(ctgFieldParams)

client.create_index((TagField('sku'), TextField('name'), TextField('desc'), NumericField('price', sortable=True), ctgField), definition=definition)