1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//!
//! ElasticLens
//!
//! > An opinionated framework to work with Elasticsearch
//!

// This stops the dead_code and unused_imports warnings from
// cropping up durring the development of code.  These warnings
// will and should still crop up during a release build
#![cfg_attr(debug_assertions, allow(dead_code, unused_imports))]
// This ensures a higher level of hygiene for a production build
#![cfg_attr(
    not(debug_assertions),
    deny(
        missing_docs,
        missing_debug_implementations,
        missing_copy_implementations,
        trivial_casts,
        trivial_numeric_casts,
        unsafe_code,
        unstable_features,
    )
)]

#[cfg(all(feature = "es_7", feature = "es_8"))]
compile_error!("feature \"es_7\" and feature \"es_8\" cannot be enabled at the same time");

pub mod client;
pub mod request;
pub mod response;

mod errors;
pub use errors::*;

/// If you `use elastic_lens::prelude::*` you will bring into
/// scope most of the functionality needed to get a client
/// setup, create requests, and parse results.
pub mod prelude {
    pub use crate::client::Client;
    pub use crate::request::search::{
        by_field, by_script, field, if_all_match, if_any_match, AggregationBuilder,
        CriteriaBuilder, IntoGeoPoint, Search, SortBuilderTrait, SubAggregationBuilder,
    };
    pub use crate::request::MultiSearch;
    pub use crate::response::{Filtered, NumericTerms, Stats, StringTerms};
}