as rest# initialize the indexqdrant_config = QdrantDocumentIndex.DBConfig(path=":memory:")db = QdrantDocumentIndex[MyDoc](qdrant_config)# index datadb.index(    [        MyDoc(            title=f"My document {i}",            title_embedding=embeddings.embed_query(f"query {i}"),            year=i,            color=random.choice(["red", "green", "blue"]),        )        for i in range(100)    ])# optionally, you can create a filter queryfilter_query = rest.Filter(    must=[        rest.FieldCondition(            key="year",            range=rest.Range(                gte=10,                lt=90,            ),        )    ])    WARNING:root:Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="title_embedding",    content_field="title",    filters=filter_query,)# find the relevant documentdoc = retriever.get_relevant_documents("some query")print(doc)    [Document(page_content='My document 80', metadata={'id': '97465f98d0810f1f330e4ecc29b13d20', 'year': 80, 'color': 'blue'})]Movie Retrieval using HnswDocumentIndex‚Äãmovies = [    {        "title": "Inception",        "description": "A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.",        "director": "Christopher Nolan",        "rating": 8.8,    },    {        "title": "The Dark Knight",        "description": "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice.",        "director": "Christopher Nolan",        "rating": 9.0,    },    {        "title": "Interstellar",        "description": "Interstellar explores the boundaries of human exploration as a group of astronauts venture through a wormhole in space. In their quest to ensure
DocArray is a versatile, open-source tool for managing your multi-modal data. It lets you shape your data however you want, and offers the flexibility to store and search it using various document index backends. Plus, it gets even better - you can utilize your DocArray document index to create a DocArrayRetriever, and build awesome Langchain apps!
DocArray is a versatile, open-source tool for managing your multi-modal data. It lets you shape your data however you want, and offers the flexibility to store and search it using various document index backends. Plus, it gets even better - you can utilize your DocArray document index to create a DocArrayRetriever, and build awesome Langchain apps! ->: as rest# initialize the indexqdrant_config = QdrantDocumentIndex.DBConfig(path=":memory:")db = QdrantDocumentIndex[MyDoc](qdrant_config)# index datadb.index(    [        MyDoc(            title=f"My document {i}",            title_embedding=embeddings.embed_query(f"query {i}"),            year=i,            color=random.choice(["red", "green", "blue"]),        )        for i in range(100)    ])# optionally, you can create a filter queryfilter_query = rest.Filter(    must=[        rest.FieldCondition(            key="year",            range=rest.Range(                gte=10,                lt=90,            ),        )    ])    WARNING:root:Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.# create a retrieverretriever = DocArrayRetriever(    index=db,    embeddings=embeddings,    search_field="title_embedding",    content_field="title",    filters=filter_query,)# find the relevant documentdoc = retriever.get_relevant_documents("some query")print(doc)    [Document(page_content='My document 80', metadata={'id': '97465f98d0810f1f330e4ecc29b13d20', 'year': 80, 'color': 'blue'})]Movie Retrieval using HnswDocumentIndex‚Äãmovies = [    {        "title": "Inception",        "description": "A thief who steals corporate secrets through the use of dream-sharing technology is given the task of planting an idea into the mind of a CEO.",        "director": "Christopher Nolan",        "rating": 8.8,    },    {        "title": "The Dark Knight",        "description": "When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice.",        "director": "Christopher Nolan",        "rating": 9.0,    },    {        "title": "Interstellar",        "description": "Interstellar explores the boundaries of human exploration as a group of astronauts venture through a wormhole in space. In their quest to ensure