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 = {"path": ["year"], "operator": "LessThanEqual", "valueInt": "90"}# 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 17', metadata={'id': '3a5b76e85f0d0a01785dc8f9d965ce40', 'year': 17, 'color': 'red'})]ElasticDocIndex‚ÄãElasticDocIndex is a document index that is built upon ElasticSearchLearn more herefrom docarray.index import ElasticDocIndex# initialize the indexdb = ElasticDocIndex[MyDoc](    hosts="http://localhost:9200", index_name="docarray_retriever")# 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 = {"range": {"year": {"lte": 90}}}# 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 46', metadata={'id': 'edbc721bac1c2ad323414ad1301528a4', 'year': 46, 'color': 'green'})]QdrantDocumentIndex‚ÄãQdrantDocumentIndex is a document index that is built upon Qdrant vector databaseLearn more herefrom docarray.index import QdrantDocumentIndexfrom qdrant_client.http import models as rest# initialize the indexqdrant_config =
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! ->: 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 = {"path": ["year"], "operator": "LessThanEqual", "valueInt": "90"}# 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 17', metadata={'id': '3a5b76e85f0d0a01785dc8f9d965ce40', 'year': 17, 'color': 'red'})]ElasticDocIndex‚ÄãElasticDocIndex is a document index that is built upon ElasticSearchLearn more herefrom docarray.index import ElasticDocIndex# initialize the indexdb = ElasticDocIndex[MyDoc](    hosts="http://localhost:9200", index_name="docarray_retriever")# 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 = {"range": {"year": {"lte": 90}}}# 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 46', metadata={'id': 'edbc721bac1c2ad323414ad1301528a4', 'year': 46, 'color': 'green'})]QdrantDocumentIndex‚ÄãQdrantDocumentIndex is a document index that is built upon Qdrant vector databaseLearn more herefrom docarray.index import QdrantDocumentIndexfrom qdrant_client.http import models as rest# initialize the indexqdrant_config =