tigris icon indicating copy to clipboard operation
tigris copied to clipboard

refactor: Only index that are needed in indexing store

Open himank opened this issue 1 year ago • 3 comments

Describe your changes

We only index fields in the indexing store that are tagged in the model

How best to test these changes

Issue ticket number and link

himank avatar May 15 '23 20:05 himank

Yes, this is tested with a collection with no search index and then updating the collection with a search index. This shouldn't crash or error anything. Note that we are not removing the fields from the search but rather just not indexing them when we don't need them. This is mainly optimizing indexing. Do you see any errors or crashes?

himank avatar May 16 '23 15:05 himank

Yes, this is tested with a collection with no search index and then updating the collection with a search index. This shouldn't crash or error anything. Note that we are not removing the fields from the search but rather just not indexing them when we don't need them. This is mainly optimizing indexing. Do you see any errors or crashes?

You can try it out like this, curl -H "content-type:application/json" '127.0.0.1:8081/v1/projects/p1/database/collections/test/createOrUpdate' -XPOST -d '{ "schema": { "title": "test", "properties": { "a": { "type": "string" }, "b": { "type": "string" } } } }

and then, curl -H "content-type:application/json" '127.0.0.1:8081/v1/projects/p1/database/collections/test/createOrUpdate' -XPOST -d '{ "schema": { "title": "test", "properties": { "a": { "type": "string", "searchIndex": true }, "b": { "type": "string" } } } }

himank avatar May 16 '23 15:05 himank

Looks good. It might be worth checking if we have an integration test with no search fields just to make sure this doesn't throw errors

Yes, many of the collection tests are not adding a search index.

himank avatar May 16 '23 16:05 himank