config=settings)Add texts and build index.metadatas = [{'string_field': "value1", "int_field": 1, 'float_field': 1.0, 'double_field': 2.0},             {'string_field': "value2", "int_field": 2, 'float_field': 3.0, 'double_field': 4.0},             {'string_field': "value3", "int_field": 3, 'float_field': 5.0, 'double_field': 6.0}]# the key of metadatas must match field_name_mapping in settings.opensearch.add_texts(texts=docs, ids=[], metadatas=metadatas)Query and retrieve data.query = "What did the president say about Ketanji Brown Jackson"docs = opensearch.similarity_search(query)print(docs[0].page_content)Query and retrieve data with metadata.query = "What did the president say about Ketanji Brown Jackson"metadata = {'string_field': "value1", "int_field": 1, 'float_field': 1.0, 'double_field': 2.0}docs = opensearch.similarity_search(query, filter=metadata)print(docs[0].page_content)If you encounter any problems during use, please feel free to contact xingshaomin.xsm@alibaba-inc.com, and we will do our best to provide you with assistance and support.PreviousActiveloop Deep LakeNextAnalyticDBCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Alibaba Cloud Opensearch is a one-stop platform to develop intelligent search services. OpenSearch was built on the large-scale distributed search engine developed by Alibaba. OpenSearch serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. OpenSearch helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises.
Alibaba Cloud Opensearch is a one-stop platform to develop intelligent search services. OpenSearch was built on the large-scale distributed search engine developed by Alibaba. OpenSearch serves more than 500 business cases in Alibaba Group and thousands of Alibaba Cloud customers. OpenSearch helps develop search services in different search scenarios, including e-commerce, O2O, multimedia, the content industry, communities and forums, and big data query in enterprises. ->: config=settings)Add texts and build index.metadatas = [{'string_field': "value1", "int_field": 1, 'float_field': 1.0, 'double_field': 2.0},             {'string_field': "value2", "int_field": 2, 'float_field': 3.0, 'double_field': 4.0},             {'string_field': "value3", "int_field": 3, 'float_field': 5.0, 'double_field': 6.0}]# the key of metadatas must match field_name_mapping in settings.opensearch.add_texts(texts=docs, ids=[], metadatas=metadatas)Query and retrieve data.query = "What did the president say about Ketanji Brown Jackson"docs = opensearch.similarity_search(query)print(docs[0].page_content)Query and retrieve data with metadata.query = "What did the president say about Ketanji Brown Jackson"metadata = {'string_field': "value1", "int_field": 1, 'float_field': 1.0, 'double_field': 2.0}docs = opensearch.similarity_search(query, filter=metadata)print(docs[0].page_content)If you encounter any problems during use, please feel free to contact xingshaomin.xsm@alibaba-inc.com, and we will do our best to provide you with assistance and support.PreviousActiveloop Deep LakeNextAnalyticDBCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.