Is it possible to query doc by id in redisearch index?

I tested to use HGET “{index_id}” and get the doc content…

the new idea is to keep the index to the doc content.

Vici,

Yes you can put the index name inside the document as a field.

yes you can store document id as field, is numeric value or string or mix? do you want to do exact match or partial match? based on that you can define the data type.

I can definitely see some use cases for having the docid available in query (and in the aggregation pipeline).

Take for example - answering a question if a given document meets a query criteria. Imagine you have a food delivery app and you were creating a view based on with some predetermined preferences (=mydocid is fictional):

FT.SEARCH myidx "@mygeofield:[113 54 20 km] @sometags:{ openlate | openearly } =mydocid"

Geospatial and tag information would be hard to parse consistently in an application.

Additionally, if you had the ability to specify an array of docids, you have a really handy way to filter out a subset.

FT.SEARCH myidx "@mygeofield:[113 54 20 km] @sometags:{ openlate | openearly } (=mydocid|=anotherdoc|=onemoredoc)"

While having the index as a field is a workaround, it would be nice to not duplicate data needlessly.