Skip to content

Sortable option missing for Tag fields #116

Closed
@dmaier-redislabs

Description

@dmaier-redislabs

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions