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

feat(server): use infix search for originalPath property #11653

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

C-Otto
Copy link
Contributor

@C-Otto C-Otto commented Aug 8, 2024

For uploaded files, the originalPath column sadly doesn't contain anything interesting. However, for users of external libraries, the path might contain very helpful information:

  • /home/user/pictures/vacations/1999/southpole/
  • /home/user/pictures/weddings/2024/adam_and_eve/
  • /home/user/pictures/random_snapshots/
  • ...

Query URLs like the following already work for originalFilename:

/search?query={"originalFileName":"IMG_123"}

For users who dare to manually change this to include originalPath instead, the pre-PR code also works, but only checks for an exact match of the value. This PR merely changes this to look for infixes, mirroring the behavior of originalFileName. This way, one can limit searches accordingly:

/search?query={"originalPath":"adam_and_eve"}

@github-actions github-actions bot added documentation Improvements or additions to documentation 🗄️server labels Aug 8, 2024
@C-Otto C-Otto changed the title use infix search for originalPath property feat(server): use infix search for originalPath property Aug 8, 2024
@C-Otto C-Otto force-pushed the original-path-infix branch 3 times, most recently from f3f0d08 to 1d3c9ac Compare August 8, 2024 14:58
@C-Otto C-Otto marked this pull request as ready for review August 8, 2024 15:06
@alextran1502
Copy link
Contributor

I believe you have to create similar index for the original file name column as well

@C-Otto
Copy link
Contributor Author

C-Otto commented Aug 8, 2024

I believe you have to create similar index for the original file name column as well

You mean originalPath? I see both a plain index (1705306747072-AddOriginalFileNameIndex) and a trigram index (1709608140355-AddAssetOriginalPathTrigramIndex). Should I add both?

Note that the file name of the trigram migration is misleading, it's adding an index for originalFileName, not originalPath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation 🗄️server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants