GithubHelp home page GithubHelp logo

Comments (8)

joein avatar joein commented on August 16, 2024 1

@geetu040 unfortunately, your answer is confusing, could you correct it please?

from qdrant-client.

geetu040 avatar geetu040 commented on August 16, 2024 1

query_text param is not working for qdrant_client.search because you are using the wronge method here. Instead you should use qdrant_client.query that accepts query_text param

So, instead of this

qdrant_client.search(collection_name="my_collection", query_text="my_text")

You code should look like this

qdrant_client.query(collection_name="my_collection", query_text="my_text")

Source Code Explanation

If you want to look into the source code then this explanation is for you
The class QdrantClient inherits the class QdrantFastembedMixin

qdrant_client/qdrant_client.py

class QdrantClient(QdrantFastembedMixin):
	...

And the class QdrantFastembedMixin implements the query method you are looking for

qdrant_client/qdrant_fastembed.py

class QdrantFastembedMixin(QdrantBase):
    ...
    def query(
        self,
        collection_name: str,
        query_text: str,
        query_filter: Optional[models.Filter] = None,
        limit: int = 10,
        **kwargs: Any,
    ) -> List[QueryResponse]:
        ...

I hope this clears your concern, let me know if I am not being clear

from qdrant-client.

joein avatar joein commented on August 16, 2024

hi @giacomobartoli

you are looking for another method - query, and it indeed accepts query_text

from qdrant-client.

geetu040 avatar geetu040 commented on August 16, 2024

QdrantClient inherits methods from QdrantFastembedMixin so you should use qdrant_client.search method instead

qdrant_client.search(collection_name="my_collection", query_text="my_text")

If you go through the source code you should find the method here
https://github.com/qdrant/qdrant-client/blob/master/qdrant_client/qdrant_fastembed.py#L325

from qdrant-client.

giacomobartoli avatar giacomobartoli commented on August 16, 2024

@geetu040 how am I supposed to change the code? Thanks for help

from qdrant-client.

giacomobartoli avatar giacomobartoli commented on August 16, 2024

Thanks a lot @geetu040. At this point I am afraid the readme is misleading.

from qdrant-client.

joein avatar joein commented on August 16, 2024

@giacomobartoli I briefly checked readme and could not find a mistake :(
Could you please point to the exact statement in readme which is incorrect?

from qdrant-client.

giacomobartoli avatar giacomobartoli commented on August 16, 2024

My bad. Readme is correct. You can close this issue.

from qdrant-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.