redis / redis/node-redis

RediSearch result

Open
#2,247 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Evaluating feature Question stale
Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

Hi,

I use this code to search products:

let products = await redisClient.ft.search(index_name , '@brand:(lg)' , {RETURN: ['$.product_type' , 'priority'] , LIMIT:{from: 0 , size:5}});

The result is:

image

How te get the result without id AND value , something like this result:

image

i use this code to get the result:

products.documents = products.documents.map(x=> { return { "priority" : x.value['priority'] , "product_type" : x.value['$.product_type'] }});
can i get the same result using redisSearch without using extra jsavascript code like i use above?

thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the node-redis ft.search API and the RediSearch RETURN and LIMIT options shown in the issue. Check how products.documents exposes id and value, and whether the client documents a response-format option; done means confirming or documenting a way to obtain only product_type and priority without the extra JavaScript mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.