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

issue #38: fix search implementation to drop use of documents view #87

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rngadam
Copy link
Contributor

@rngadam rngadam commented Mar 20, 2024

Fixes #38

Got search down to 731ms with ailab-db on our Azure Flexible Postgresql search instance (schema louis_v005)

changed :

  • remove use of the documents view
  • turn md5hash into md5hash_uuid and index newly created md5hash_uuid
  • index html_content_to_chunk.chunk_id

this includes archiving the query and using precomputed document scores to sort docs.

TODO

But I see that finesse_backend actually uses match_documents:

https://github.com/ai-cfia/finesse-backend/blob/107c79f28311852376201dcd6ab931a3a769a627/app/ailab_db/__init__.py#L22C20-L22C51

instead of search:

def search(cursor, query_embedding):

@rngadam rngadam requested a review from k-allagbe March 20, 2024 20:47
@rngadam rngadam requested a review from a team as a code owner March 20, 2024 20:47
@rngadam rngadam linked an issue Mar 20, 2024 that may be closed by this pull request
8 tasks
Copy link
Member

@k-allagbe k-allagbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and results are under 900ms 🚀. Only missing an end of file.

sql/2024-03-20-html_content_to_chunk_chunk_id_idx.sql Outdated Show resolved Hide resolved
Copy link
Member

@k-allagbe k-allagbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with the tests failing but I reported it here #90

Copy link
Contributor

@JolanThomassin JolanThomassin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good for me

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

Successfully merging this pull request may close these issues.

Correct delay in response to a search in ailab-db
3 participants