RediSearch icon indicating copy to clipboard operation
RediSearch copied to clipboard

FT.AGGREGATE GroupBy Count always returns the attributes values in lower case

Open nadavtsa opened this issue 2 years ago • 4 comments

My use case: I inserted a document with attribute name = "Nadav" but when running "FT.AGGREGATE GroupBy Count" for that attribute I got: {"nadav": 1} instead of {"Nadav": 1}

Moreover, if I save one document with name = "Nadav" and one document with name = "nAdav" it will return {"nadav": 2} instead of: {{"Nadav": 1, "nAdav":1}}

nadavtsa avatar Nov 06 '22 10:11 nadavtsa

Thanks @nadavtsa for the question. This is part of the RediSearch design. fields with SORTABLE values are normalized by default to avoid the difference between the sea word at the start and the rest of the sentence. RediSearch has an additional flag - UNF which stands for unformatted. This will fix the issue you experience.

ashtul avatar Nov 06 '22 12:11 ashtul

@ashtul How do I set this flag? can you give me a command for example?

Thank you very much!

nadavtsa avatar Nov 06 '22 12:11 nadavtsa

@ashtul Another question: can I set the same field in the schema both as UNF and non-UNF or do I need to create 2 separate indexes?

I'll explain, I need to support case insensitive text search but case sensitive facets

nadavtsa avatar Nov 06 '22 13:11 nadavtsa

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Nov 09 '23 01:11 github-actions[bot]