You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update Elastic Search, QDrant, and PGVector to retrieve_online_documents_v2 method #5115
Is your feature request related to a problem? Please describe.
Update Elastic Search, QDrant, and PGVector to retrieve_online_documents_v2 method, as it returns broader features.
Describe the solution you'd like
V2 is the better method.
For the implementation of retrieve_online_documents_v2 with PGVector, I compared the available options for text search.
There are two main approaches:
Using LIKE or ILIKE
Simple pattern matching for substrings.
Easy to implement, but does not support ranking, stemming, or advanced text analysis.
Performance is not optimal for large datasets, especially without proper indexing.
Does not integrate well if we plan to combine text and vector scores.
Using PostgreSQL Full-Text Search (to_tsvector and to_tsquery)
Tokenizes text, removes stop words, and supports stemming.
Supports relevance ranking.
Performs better on larger datasets when combined with GIN indexing.
Can work in combination with vector search for hybrid retrieval.
Example:
WHERE to_tsvector('english', content) @@ to_tsquery('english', 'keyword')
Recommendation: to_tsvector and to_tsquery full-text search is more effective based on my view. but we need to change PGvector config as it will require language
I noticed that in the v2 method there isn’t any configuration option for specifying the language for Lemxme. Without this setting, we might run into limitations when handling non-English content, especially since full-text search features (like stemming and tokenization in PostgreSQL's to_tsvector/to_tsquery) can benefit from language-specific configuration. It might be worth exploring the addition of a language parameter to make the method more flexible and accurate for diverse datasets. What do you think?
Activity
YassinNouh21 commentedon Mar 31, 2025
@franciscojavierarceo can I work on this issue ?
franciscojavierarceo commentedon Mar 31, 2025
Of course!
YassinNouh21 commentedon Apr 1, 2025
@franciscojavierarceo can I create a pr for each one starting with Qdrant ?
franciscojavierarceo commentedon Apr 1, 2025
Yeah of course!
YassinNouh21 commentedon Apr 6, 2025
@franciscojavierarceo ,
For the implementation of
retrieve_online_documents_v2with PGVector, I compared the available options for text search.There are two main approaches:
Using
LIKEorILIKEUsing PostgreSQL Full-Text Search (
to_tsvectorandto_tsquery)Recommendation:
to_tsvectorandto_tsqueryfull-text search is more effective based on my view. but we need to change PGvector config as it will require languagefranciscojavierarceo commentedon Apr 7, 2025
Nice, I think (2) sounds good. I'd probably mention (1) in another ticket in case someone wants to pick it up in the future or compare it.
YassinNouh21 commentedon Apr 7, 2025
@franciscojavierarceo
I noticed that in the v2 method there isn’t any configuration option for specifying the language for Lemxme. Without this setting, we might run into limitations when handling non-English content, especially since full-text search features (like stemming and tokenization in PostgreSQL's to_tsvector/to_tsquery) can benefit from language-specific configuration. It might be worth exploring the addition of a language parameter to make the method more flexible and accurate for diverse datasets. What do you think?
franciscojavierarceo commentedon Apr 7, 2025
Yeah that makes a lot of sense! Do you mind defaulting it to
en-us?YassinNouh21 commentedon Apr 7, 2025
it will look like this
franciscojavierarceo commentedon Apr 7, 2025
hmm, we could probably have a dict for that lookup.