Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Plugin settings for disabling real-time indexing for large documents #57

Closed
shaggyfeng opened this issue May 21, 2022 · 9 comments
Milestone

Comments

@shaggyfeng
Copy link

Is your feature request related to a problem? Please describe.

When typing in a document that has a lot of words (300,000ish), this plugin will cause some lag. I tested it many times to make sure the lag was caused by Omni Search.

Describe the solution you'd like

It would be great to have a plugin option to turn off real-time indexing for documents that have more than a certain number of characters.

Describe alternatives you've considered

Or simply provide an option to only index new words when opening obsidian. That might fix the lag, I guess.

Additional context

Your plugin is the best searching plugin IMO! Thanks

@shaggyfeng shaggyfeng changed the title [Feature request] [Feature request] Plugin settings for disabling real-time indexing for large documents May 21, 2022
@scambier
Copy link
Owner

When typing in a document that has a lot of words (300,000ish), this plugin will cause some lag.

Oh boy I'm sure it does. Is the lag longer than 1-2 seconds?

If not, what about an option to re-index edited documents when Obisidian is alt-tabbed out? So the indexing is done in the background, and should be done once you're back.

Your plugin is the best searching plugin IMO! Thanks

@shaggyfeng
Copy link
Author

Well, whenever I tried to type anything, anywhere within a large document, input would lag for 1 second.

Indexing in the background does sound like a good idea. I guess as long as no indexing happens when writing or editing a large document, we should not have any lagging issues.

Thanks

@scambier
Copy link
Owner

scambier commented May 24, 2022

Fixed and published in 1.3.2-beta (accessible through BRAT)

scambier added a commit that referenced this issue May 25, 2022
@shaggyfeng
Copy link
Author

shaggyfeng commented Jun 8, 2022

Fixed and published in 1.3.2-beta (accessible through BRAT (乳臭未干) )

When I copy text from another APP to Obsidian, the cursor will lag for a few seconds if the MD file has a lot of words (200k) in it. When I turn the omni (v1.3.4) plugin off, there is no lag.

I guess a 15-second delay before the alt-tabbed-out index might fix this issue.

Thanks

@scambier
Copy link
Owner

scambier commented Jun 9, 2022

@shaggyfeng can you make sure that this setting is unchecked?
image

If that's the case, does the lag happen only when you first paste the text (and tab out of obsidian), or every time you write something?

@shaggyfeng
Copy link
Author

shaggyfeng commented Jun 9, 2022

The lag happens every time I paste the text (tab out of obsidian). When I copy outside of obsidian and paste inside of obsidian, it lags every time.

If I use obsidian side by side with other apps, Omni thinks I am taking a break, but that is not the case. So if you add a delay to the indexing after tab-out of obsidian, it should work just fine. Maybe something like a 15 or 30 seconds delay will be all right.

Thanks

@scambier
Copy link
Owner

scambier commented Jun 9, 2022

I'll tweak the settings to get something less intrusive.

@scambier scambier reopened this Jun 9, 2022
@scambier scambier added this to the 1.4 milestone Jun 9, 2022
@shaggyfeng
Copy link
Author

I'll tweak the settings to get something less intrusive (侵入) .

Is it a good idea to terminate the indexing if a user tabs back to obsidian and the indexing is still running after, let's say 1000ms? Just a thought. Just ignore me if it is not helpful.

Thanks

@scambier
Copy link
Owner

Nope sorry. Once a document is starting to get indexed, you can't stop it; it's a synchronous process. You can stop between documents, but I don't think it'd be useful in your use-case, since you're alt-tabbing and copying (I guess) one document at a time.

If the startup indexing time is also a problem for you, the latest beta introduced a feature to save the index on disk and reload it at startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants