Expand description
OpenSearch Query Builder for Rust
This library provides a type-safe, builder-pattern API for constructing OpenSearch queries. It supports various query types including term-level queries, full-text queries, and compound queries.
§Features
- Type-safe query building: Compile-time checking of query structure
- Builder pattern: Fluent API for constructing complex queries
- Comprehensive coverage: Support for most OpenSearch query types
- Serialization: Automatic JSON serialization using Serde
§Quick Start
use os_query_builder_rs::model::Query;
use os_query_builder_rs::term::term::Term;
// Create a simple term query
let query = Query::new()
.query(Term::new("field", "value"));
// Serialize to JSON
let json = serde_json::to_string(&query).unwrap();§Query Types
- Term-level queries:
Term,Terms,Range,Exists, etc. - Full-text queries:
Match,MultiMatch,QueryString, etc. - Compound queries:
Bool,Boosting,ConstantScore, etc.
§Examples
See the individual module documentation and test files for more examples.
§Crate Organization
model- Core query structure and builderterm- Term-level queriesfull_text- Full-text search queriescompound_query- Compound query combinatorsmisc- Supporting types and utilities
Modules§
- compound_
query - full_
text - misc
- model
- Core query model and builder types
- term