yayatip
yayatip

Reputation: 79

How to use nocontent flag with ft.search to retrieve only keys

I have a requirement to search through redis cache using full text search but the response I get has key and value which is a lot of data. I just need key string to clean up those cache entries later.

client.ft.search(index, searchString,{ LIMIT: { from: 0, size: 0 }});

Is there a way to pass nocontent flag in the above query similar to redis FT.SEARCH?

FT.SEARCH "idx:index" "@response:*search_text*" LIMIT 0 0 nocontent

Upvotes: 0

Views: 200

Answers (1)

yayatip
yayatip

Reputation: 79

There is a method in node-redis API to fetch keys without any values

client.ft.searchNoContent(index, searchString,{ LIMIT: { from: 0, size: 0 }});

Please refer documentation here

Upvotes: 0

Related Questions