rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

Ability to apply filter by metadata without affecting scoring #63

Closed fabito closed 7 years ago

fabito commented 7 years ago

First if all, thanks for the library, very useful and easy to setup.

We are working on a multitenant application and we are planning to use the metadata property to add the tenant_id. When searching for matches we need to do it in the context of a specific tenant.

The idea of this PR is to add a new (optional) filter parameter to the search_image method, so that drivers could apply it before actually trying to find matches.

A few questions:

  1. Does it make sense ? Are you interested in such a feature ?
  2. I'd like to write some tests for the ES implementation. Can anyone instruct me how do I run the integration tests ?
  3. I have no idea how to add this feature to the Mongo driver. Is it a problem ?
rhsimplex commented 7 years ago

First of all, thank you for @fabito not only for the PR but also the test coverage :heart_eyes:!!

I'm on vacation for the next week and a half, but I will try to have a look at it soon. So please be patient if you don't hear back from me for some days!

To answer your questions:

  1. Yes, this is an excellent idea for a feature, and I think others will use it.
  2. Don't worry about mongodb, I don't have test coverage for it and I don't think anyone is using it.
rhsimplex commented 7 years ago

Thanks again @fabito