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

Include extracted PDF content in the parent note when embedded #307

Closed
wants to merge 4 commits into from

Conversation

sbj175
Copy link

@sbj175 sbj175 commented Oct 24, 2023

Note about the event listeners:
I could not find a case where the vault modify event triggered without also triggering the metadataCache changed event. So rather than having them be redundant and update the index twice, I replaced the first one with the second one.

Also! This is the first time I've ever done a pull request. Git/Github, VSCode, JavaScript/TypeScript are all new to me, so if there's anything missing that you'd normally expect, just let me know.

@scambier
Copy link
Owner

First, thanks for your PR :)

That's not how I envisioned the solution at all 😅

My idea was to keep pdfs/images and notes separated (as they are currently), but create a link between them. E.g. tabbing on a pdf/image would bring all linked notes. Kinda like how the "in-file search" switch works, since it's currently useless for pdfs & images.
image
Omnisearch would keep an up-to-date index of links between files and notes.


Technically your PR does the job, but I'm really unsure about the implications and how it will affect the results.

By merging both into a single result, you lose the context and make it unclear if the result is going to be a pdf/image or a note. The ranking of a result will now be affected by its embeds (which may be desirable?). The in-file search will also become potentially useless/buggy on merged results.

Though for a first, it's a great PR :) don't take these remarks as criticism of your work, as I should have been clearer about what I expected when you contacted me. That's definitely on me, sorry.

(Related FR: #245)

@sbj175
Copy link
Author

sbj175 commented Oct 24, 2023

Thanks for the feedback. And don't worry, I don't feel criticized at all. I've worked in IT many years and have had lots of work not get used. Just how it is sometimes.

We'll call this a rough draft then. I'm not sure I know how to implement what you're suggesting, but I'll give it a look. In the meantime, I can make use of this as is. I'm trying to get off of Evernote and this was one of the missing pieces. Multi-note tagging and untagging is another.

I'll be in touch if I have further results to share.

@scambier
Copy link
Owner

I've worked in IT many years and have had lots of work not get used.

Aaaaah I know how it feels, doubly sorry 💀

Let's keep this PR open then. Don't hesitate to ask, I'll be happy to answer

@sbj175
Copy link
Author

sbj175 commented Oct 24, 2023

Just a thought. Unless I'm not understanding, by keeping them separate, would you be able to combine a tag search (only found in markdown) with a pdf text search (only found in the pdf)? The implied AND would never find them both.

@scambier
Copy link
Owner

Just a thought. Unless I'm not understanding, by keeping them separate, would you be able to combine a tag search (only found in markdown) with a pdf text search (only found in the pdf)? The implied AND would never find them both.

Yep. I never intended to mix pdf content and notes, only to facilitate finding notes referencing a pdf. Though now that you say it, I understand how it would make sense to search for embedded files.

(nb: notes can embed other notes, do we want this feature to work for those?)

A way to do this more cleanly than appending to the content would be to add another indexed field. That would allow the search to correctly work on a note content + its embeds (and the weight of embeds could be tweaked).

But that would require changes to the UI, to make it clear that a result is surfaced because of an embed.

@scambier scambier added enhancement New feature or request high value This issue should be "easily" doable and be useful for many users labels Apr 21, 2024
@scambier scambier closed this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high value This issue should be "easily" doable and be useful for many users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants