| Crates.io | armature-opensearch |
| lib.rs | armature-opensearch |
| version | 0.1.1 |
| created_at | 2025-12-26 22:05:23.140702+00 |
| updated_at | 2025-12-29 01:20:02.659868+00 |
| description | OpenSearch integration for the Armature framework |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006332 |
| size | 164,839 |
OpenSearch integration for the Armature framework.
[dependencies]
armature-opensearch = "0.1"
use armature_opensearch::{OpenSearchClient, Document, Query};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = OpenSearchClient::new("http://localhost:9200").await?;
// Index a document
client.index("products", "1", &product).await?;
// Search
let results = client.search::<Product>("products")
.query(Query::match_field("name", "laptop"))
.size(10)
.execute()
.await?;
// Bulk operations
client.bulk()
.index("products", "2", &product2)
.delete("products", "old-id")
.execute()
.await?;
Ok(())
}
let query = Query::bool()
.must(Query::match_field("category", "electronics"))
.filter(Query::range("price").gte(100).lte(500))
.should(Query::term("featured", true));
MIT OR Apache-2.0