hkulekci / qdrant-php

Qdrant is a vector similarity engine & vector database. It deploys as an API service providing search for the nearest high-dimensional vectors. With Qdrant, embeddings or neural network encoders can be turned into full-fledged applications for matching, searching, recommending, and much more!
MIT License
93 stars 21 forks source link

Multiple Vector Support #14

Closed gregpriday closed 1 year ago

gregpriday commented 1 year ago

Resolves #13

This is still a work in progress. Not happy with it yet, and I still need to write the tests, but putting this up in case you have any comments or would prefer a different direction.

One breaking change I made was using VectorStructInterface for the $vector argument of the Point constructor. This makes a lot more sense to me.

I've also structured the MultiVectorStruct in a way that makes it only compatible with Qdrant 1.2.

hkulekci commented 1 year ago

I think we need to remove lock file. Our releases are more stable and no need to keep it, too. I will do it in couple of minutes.

hkulekci commented 1 year ago

We can rebase the branch to the main. I removed the composer.lock file.

hkulekci commented 1 year ago

We need to add some tests. Also, here is the documentation for multiple vector support

Nikcrysis commented 1 year ago

Hey guys, need a multiply vector support. Is it working with this realisation?

hkulekci commented 1 year ago

I am in vacation. I will check again as soon as possible. @Nikcrysis

hkulekci commented 1 year ago

Hello @gregpriday if you dont have time to finish maybe I can work on this PR. What do you think?

hkulekci commented 1 year ago

Okay PR rebased and I just push a change for PointsBatch request class. Please pull the changes on your local to test. Ping @gregpriday

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 78.57% and project coverage change: +0.12% :tada:

Comparison is base (8e62cb1) 87.48% compared to head (cda9f1f) 87.60%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #14 +/- ## ============================================ + Coverage 87.48% 87.60% +0.12% - Complexity 263 278 +15 ============================================ Files 56 57 +1 Lines 903 936 +33 ============================================ + Hits 790 820 +30 - Misses 113 116 +3 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `87.60% <78.57%> (+0.12%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0) | Coverage Δ | | |---|---|---| | [src/Exception/InvalidArgumentException.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL0V4Y2VwdGlvbi9JbnZhbGlkQXJndW1lbnRFeGNlcHRpb24ucGhw) | `60.00% <ø> (ø)` | | | [src/Models/Request/Point.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9SZXF1ZXN0L1BvaW50LnBocA==) | `0.00% <0.00%> (ø)` | | | [src/Models/Request/SearchRequest.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9SZXF1ZXN0L1NlYXJjaFJlcXVlc3QucGhw) | `93.33% <40.00%> (-6.67%)` | :arrow_down: | | [src/Models/MultiVectorStruct.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9NdWx0aVZlY3RvclN0cnVjdC5waHA=) | `90.90% <90.90%> (ø)` | | | [src/Models/PointStruct.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9Qb2ludFN0cnVjdC5waHA=) | `100.00% <100.00%> (ø)` | | | [src/Models/PointsStruct.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9Qb2ludHNTdHJ1Y3QucGhw) | `100.00% <100.00%> (+20.00%)` | :arrow_up: | | [src/Models/VectorStruct.php](https://app.codecov.io/gh/hkulekci/qdrant-php/pull/14?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Haydar+K%C3%9CLEKC%C4%B0#diff-c3JjL01vZGVscy9WZWN0b3JTdHJ1Y3QucGhw) | `100.00% <100.00%> (+5.55%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gregpriday commented 1 year ago

@hkulekci Great, I'll start working on this again today. I have a few other PRs and suggestions coming too.

hkulekci commented 1 year ago

Great! I just rebased the branch FYI.

gregpriday commented 1 year ago

@hkulekci I've added some tests and made a few more changes. I can try to add a few more tests to hit the Codecov requirements.

Is there anything else on my task list for this feature or are we ready to go once I had a few more tests?

hkulekci commented 1 year ago

In fact, I am grateful for all this contributions. Thanks. I will do a last check after you finish all changes. Just change it as ready for merge whenever it is ready.