spacedrive icon indicating copy to clipboard operation
spacedrive copied to clipboard

[ENG-681] Update indexer rules

Open utkubakir opened this issue 2 years ago • 12 comments

You can only create or delete a indexer rule which is very cringe.

From SyncLinear.com | ENG-681

utkubakir avatar Aug 01 '23 12:08 utkubakir

so I guess we'll need to wait for updating indexing rules to exist for that, no worries

utkubakir avatar Aug 01 '23 12:08 utkubakir

We should be able to? They’re all stored in the DB after all

utkubakir avatar Aug 01 '23 12:08 utkubakir

We should also be able to see the contents of the system indexer rules, no? could be helpful for tech users.

utkubakir avatar Aug 01 '23 12:08 utkubakir

Re-index i guess

Brendonovich avatar Aug 07 '23 15:08 Brendonovich

probs worth asking @jamie

Brendonovich avatar Aug 11 '23 09:08 Brendonovich

at rule update

utkubakir avatar Aug 11 '23 11:08 utkubakir

Just note that eagerly re-indexing every location at rule update can be pretty expensive

fogodev avatar Aug 13 '23 15:08 fogodev

@ericson.ds999 so are you recommending the shallow indexing? We could have a toast show up with re-index button on rule update to give user the choice

utkubakir avatar Sep 11 '23 05:09 utkubakir

Not exactly, but you got me thinking. After updating an indexer rule we can show a modal in the frontend, warning the user with the list of locations that will be affected. Saying that the user can eagerly re-index them (maybe showing buttons to directly re-index as you pointed) or just keep using app and these locations will be updated directory by directory as the user opens them. What you guys think? @utkubakir @jamiepine

fogodev avatar Sep 11 '23 22:09 fogodev

What if user never opens that folder? We will have that folder/file in our database for no reason at all.

Can we make a job to scan the database with those indexer rules in mind? Like instead of going through each file, it would directly search for it on the database. For example: FilePaths starting with "downloads/" or something? Triggering this job after each update doesn't sound bad to me.

@Brendonovich any feedback on the possibility of this query with prisma?

utkubakir avatar Sep 12 '23 05:09 utkubakir

Indexer rules can contain globs and be rather complex - SQLite, nevermind Prisma, can't handle that. It'd have to be done in Rust. Also, that doesn't account for files that haven't been indexed yet, which would require a complete re-index to detect.

Brendonovich avatar Sep 12 '23 07:09 Brendonovich

So the best way for us is basically re-index the location and hope for the best

utkubakir avatar Sep 12 '23 08:09 utkubakir