isn‚Äôt true. I signed 80 bipartisan bills into law last year. From preventing government shutdowns to protecting Asian-Americans from still-too-common hate crimes to reforming military justice.', metadata={'source': '../../modules/state_of_the_union.txt'})]MetadataElasticsearchStore supports metadata to stored along with the document. This metadata dict object is stored in a metadata object field in the Elasticsearch document. Based on the metadata value, Elasticsearch will automatically setup the mapping by infering the data type of the metadata value. For example, if the metadata value is a string, Elasticsearch will setup the mapping for the metadata object field as a string type.# Adding metadata to documentsfor i, doc in enumerate(docs):    doc.metadata["date"] = f"{range(2010, 2020)[i % 10]}-01-01"    doc.metadata["rating"] = range(1, 6)[i % 5]     doc.metadata["author"] = ["John Doe", "Jane Doe"][i % 2]db = ElasticsearchStore.from_documents(    docs, embeddings, es_url="http://localhost:9200", index_name="test-metadata")query = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2016-01-01', 'rating': 2, 'author': 'John Doe'}Filtering Metadata‚ÄãWith metadata added to the documents, you can add metadata filtering at query time. Example: Filter by keyword‚Äãdocs = db.similarity_search(query, filter=[{ "match": { "metadata.author": "John Doe"}}])print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2010-01-01', 'rating': 1, 'author': 'John Doe', 'geo_location': {'lat': 40.12, 'lon': -71.34}}Example: Filter by Date Range‚Äãdocs = db.similarity_search("Any mention about Fred?", filter=[{ "range": { "metadata.date": { "gte": "2010-01-01" }}}])print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2012-01-01', 'rating': 3, 'author': 'John Doe', 'geo_location': {'lat': 40.12,
Elasticsearch is a distributed, RESTful search and analytics engine, capable of performing both vector and lexical search. It is built on top of the Apache Lucene library.
Elasticsearch is a distributed, RESTful search and analytics engine, capable of performing both vector and lexical search. It is built on top of the Apache Lucene library. ->: isn‚Äôt true. I signed 80 bipartisan bills into law last year. From preventing government shutdowns to protecting Asian-Americans from still-too-common hate crimes to reforming military justice.', metadata={'source': '../../modules/state_of_the_union.txt'})]MetadataElasticsearchStore supports metadata to stored along with the document. This metadata dict object is stored in a metadata object field in the Elasticsearch document. Based on the metadata value, Elasticsearch will automatically setup the mapping by infering the data type of the metadata value. For example, if the metadata value is a string, Elasticsearch will setup the mapping for the metadata object field as a string type.# Adding metadata to documentsfor i, doc in enumerate(docs):    doc.metadata["date"] = f"{range(2010, 2020)[i % 10]}-01-01"    doc.metadata["rating"] = range(1, 6)[i % 5]     doc.metadata["author"] = ["John Doe", "Jane Doe"][i % 2]db = ElasticsearchStore.from_documents(    docs, embeddings, es_url="http://localhost:9200", index_name="test-metadata")query = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2016-01-01', 'rating': 2, 'author': 'John Doe'}Filtering Metadata‚ÄãWith metadata added to the documents, you can add metadata filtering at query time. Example: Filter by keyword‚Äãdocs = db.similarity_search(query, filter=[{ "match": { "metadata.author": "John Doe"}}])print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2010-01-01', 'rating': 1, 'author': 'John Doe', 'geo_location': {'lat': 40.12, 'lon': -71.34}}Example: Filter by Date Range‚Äãdocs = db.similarity_search("Any mention about Fred?", filter=[{ "range": { "metadata.date": { "gte": "2010-01-01" }}}])print(docs[0].metadata)    {'source': '../../modules/state_of_the_union.txt', 'date': '2012-01-01', 'rating': 3, 'author': 'John Doe', 'geo_location': {'lat': 40.12,