Re-indexing Questions

Greetings All…

I’ve noticed that when Redisearch re-indexes that the order of document entries/rows seems to change. In other words, If the document hash looked like this:

Row Key Value
1 Author Kafka
2 Title The Trial
3 Year 1915

``

Then after a re-indexing it might look like this:

Row Key Value
1 Author Kafka

2 Year 1915
3 Title The Trial

So, documents in RediSearch are basically just Redis hashes. And, just like hashes, have no recorded field order which doesn’t have anything to with (re)indexing.

If you do need to control the order of the returned documents, you can explicitly add the RETURN arguments to your FT.SEARCH command. This works great if you have a fixed set of returned fields that are all in the schema, but that isn’t always the case.

-Kyle

Thanks, Kyle… This insight is actually a huge help because in most of my use cases so far the indexed content has a fixed set of fields!! :slight_smile: