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

Multiple Vector Support #14

Merged
merged 11 commits into from
Aug 6, 2023

Conversation

gregpriday
Copy link
Contributor

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.

@gregpriday gregpriday changed the title Feature/multiple vector support Multiple Vector Support Jun 2, 2023
@hkulekci
Copy link
Owner

hkulekci commented Jun 4, 2023

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
Copy link
Owner

hkulekci commented Jun 4, 2023

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

src/Models/VectorStructInterface.php Show resolved Hide resolved
src/Models/VectorStructInterface.php Show resolved Hide resolved

/**
* @var array|null Payload values (optional)
*/
protected ?array $payload = null;

public function __construct(string $id, array $vector, array $payload = null)
public function __construct(string $id, VectorStructInterface|array $vector, array $payload = null)
Copy link
Owner

Choose a reason for hiding this comment

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

In my opinion, we can continue with an interface instead of an array, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean leave it as is now, or should I remove support for arrays?

Copy link
Owner

Choose a reason for hiding this comment

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

I mean that we can continue with interface directly. Without array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's been a few weeks, so just confirming that you'd like me to remove array as an option for $vector in this constructor?

It would be neater removing array, but for backwards compatibility it does help. We could also mark array for removal in a future version and just trigger a warning when an array is passed for $vector.

src/Models/PointsStruct.php Show resolved Hide resolved
@hkulekci
Copy link
Owner

hkulekci commented Jun 4, 2023

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

@Nikcrysis
Copy link

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

@hkulekci
Copy link
Owner

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

@hkulekci
Copy link
Owner

hkulekci commented Jul 2, 2023

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

@hkulekci hkulekci force-pushed the feature/multiple-vector-support branch from fd7ccdc to d469380 Compare July 2, 2023 23:13
@hkulekci
Copy link
Owner

hkulekci commented Jul 2, 2023

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
Copy link

codecov bot commented Jul 2, 2023

Codecov Report

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

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

Additional details and impacted files
@@             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%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/Exception/InvalidArgumentException.php 60.00% <ø> (ø)
src/Models/Request/Point.php 0.00% <0.00%> (ø)
src/Models/Request/SearchRequest.php 93.33% <40.00%> (-6.67%) ⬇️
src/Models/MultiVectorStruct.php 90.90% <90.90%> (ø)
src/Models/PointStruct.php 100.00% <100.00%> (ø)
src/Models/PointsStruct.php 100.00% <100.00%> (+20.00%) ⬆️
src/Models/VectorStruct.php 100.00% <100.00%> (+5.55%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gregpriday
Copy link
Contributor Author

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

@hkulekci
Copy link
Owner

hkulekci commented Jul 4, 2023

Great! I just rebased the branch FYI.

@gregpriday
Copy link
Contributor Author

@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
Copy link
Owner

hkulekci commented Jul 5, 2023

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.

@hkulekci hkulekci force-pushed the feature/multiple-vector-support branch from b74b0d9 to 0fbaf1b Compare August 6, 2023 06:07
@hkulekci hkulekci marked this pull request as ready for review August 6, 2023 06:07
@hkulekci hkulekci merged commit 5b69412 into hkulekci:main Aug 6, 2023
3 of 4 checks passed
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.

Support for multiple vectors in VectorStruct
3 participants