Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

[Feature Request] Full text search #11

Open
zeylos opened this issue Jan 29, 2020 · 6 comments
Open

[Feature Request] Full text search #11

zeylos opened this issue Jan 29, 2020 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zeylos
Copy link

zeylos commented Jan 29, 2020

Hi there !

Just installed your app on FreeBSD today, was looking for a simple diary app and I'm very satisfied so far.
Thanks for the good work !
I was wondering, do you plan to add a full text search feature ? I imagine something that could search in the title of the entry and/or in the text and show only the entries matching. If it could filter by date that'd be awesome too.
Finally (for the hype) if the search box could be dynamic (something showing the X first hits while typing the research) that would be perfect !
Sadly I can't really help with the code as I don't know ruby at all...
However I can help with the installation docs if needed.
Keep up the good job !
Best regards

@Sutto
Copy link

Sutto commented Aug 8, 2020

Full Text search would be harder because of the encrypted content - There is a way to do full-text search in Postgres that is pretty dang good, but the fact it's encrypted makes that hard.

PG does have some great decryption tools as well, but that'd require some work with exposing the encryption keys.

Other approach, design wise would be to dynamically build (and store in memory) a full text index using something like Picky, but that'd be super expensive - because you'd have to dynamically build the index on search time, which would be prohibitive.

@inoda
Copy link
Owner

inoda commented Aug 8, 2020

@zeylos Because of the constraints @Sutto called out (thanks!), I have no plans of implementing full text search. That being said, if your pain point is retroactively finding journal posts, I could add one/all of the following if you think it would solve your use case:

  1. A tagging system. The tag names could be unencrypted, and be essentially a proxy to text search on. I actually had this in the initial build and ripped it out because I never used it.
  2. Date filter as you suggested.

Let me know what you think!

@zeylos
Copy link
Author

zeylos commented Aug 9, 2020

Hi,
Thank you both for the clarification!
I don't think I will use tags at all as I'm not used to it.
Date filtering would be awesome, I'm thinking of something like "show me stuff I wrote between two dates" kind of filtering, but if you have something else in mind or if it's too complicated let me know what you have in mind.

Thanks a lot for your answers!

@jtagcat
Copy link
Contributor

jtagcat commented Jan 14, 2022

Often cases, the database and app are hosted on the same place. It's text-only, there is no practical need to have the app and db on separate machines. The host is already trusted.

As I understand, there is nothing the end user provides as the encryption key — the app, server-side is currently responsible for encryption. Who has access to db has access to the app. You could advocate for backups and replication, but you can do that encrypted with both Postgres and external tools (such as restic).

Going full devil's advocate, in the somebody has access to the db, and not the app for some reason, they can still brute force it, or wait it out, a decade or so, when a vulnerability might be found. What I'd do with malicious intent: break the db: you will come to fix it, and likely at some point, the credentials are leaked / accessible.

You are overengineering it. What does encrypting the db give? Did I miss anything? Right now, it's standing in the way of a major feature, without giving any benefits.

@jlar0che
Copy link

Just throwing in my perspective:

  1. A tagging system would be great.
  2. I think @jtagcat is spot on: Full text search of the titles and the content is a fantastic feature.

@inoda
Copy link
Owner

inoda commented Feb 27, 2022

Feel free to open a PR!

@inoda inoda added enhancement New feature or request help wanted Extra attention is needed labels Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants