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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//! # Strongly typed Elasticsearch DSL written in Rust
//!
//! This is an unofficial library and doesn't yet support all the DSL, it's still work in progress.
//!
//! ## Features
//!
//! - Strongly typed queries
//! - Strongly typed aggregations
//! - Automatically skips empty queries making DSL pleasant to use
//! - Crate doesn't depend on [elasticsearch-rs](https://github.com/elastic/elasticsearch-rs) and can be used as a standalone library with any HTTP client to call Elasticsearch
//!
//! ## Installation
//!
//! Add `elasticsearch-dsl` crate and version to Cargo.toml
//!
//! ```toml
//! [dependencies]
//! elasticsearch-dsl = "0.2"
//! ```
//!
//! ## Documentation
//!
//! Documentation for the library is available on [docs.rs](https://docs.rs/elasticsearch-dsl)
//!
//! ## Quick start
//!
//! ```rust
//! use elasticsearch_dsl::*;
//!
//! let query = Search::new()
//!     .source(false)
//!     .stats("statistics")
//!     .from(0)
//!     .size(30)
//!     .query(
//!         Query::bool()
//!             .must(Query::multi_match(
//!                 ["title", "description"],
//!                 "you know, for search",
//!             ))
//!             .filter(Query::terms("tags", ["elasticsearch"]))
//!             .should(Query::term("verified", true).boost(10)),
//!     )
//!     .aggregate(
//!         "country_ids",
//!         Aggregation::terms("country_id")
//!             .aggregate("catalog_ids", Aggregation::terms("catalog_id"))
//!             .aggregate("company_ids", Aggregation::terms("company_id"))
//!             .aggregate(
//!                 "top1",
//!                 Aggregation::top_hits()
//!                     .size(1)
//!                     .sort(FieldSort::ascending("user_id")),
//!             ),
//!     ).rescore(Rescore::new(Query::term("field", 1)).query_weight(1.2));
//! ```
//!
//! See examples for more.
//!
//! #### License
//!
//! <sup>
//! Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
//! 2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
//! </sup>
#![doc(
    html_logo_url = "https://play-lh.googleusercontent.com/VvtT2Dvf_oOC3DL4c2i5hfNvwIqzdU2apScRMlmeRW10Yf-vJXnXqAjdNWE9KW5YvK0"
)]
#![deny(
    bad_style,
    dead_code,
    deprecated,
    improper_ctypes,
    missing_debug_implementations,
    missing_docs,
    non_shorthand_field_patterns,
    no_mangle_generic_items,
    overflowing_literals,
    path_statements,
    patterns_in_fns_without_body,
    trivial_casts,
    trivial_numeric_casts,
    unconditional_recursion,
    unknown_lints,
    unreachable_code,
    unreachable_pub,
    unused,
    unused_allocation,
    unused_comparisons,
    unused_extern_crates,
    unused_import_braces,
    unused_mut,
    unused_parens,
    unused_qualifications,
    unused_results,
    warnings,
    while_true
)]
#![allow(ambiguous_glob_reexports)]

#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;

#[macro_use]
extern crate serde;

#[cfg(test)]
#[macro_use]
extern crate serde_json;

// Macro modules
#[macro_use]
mod macros;
mod types;

// Crate modules
#[macro_use]
pub(crate) mod util;
pub(crate) use self::types::*;

// Public modules
pub mod analyze;
pub mod search;

// Public re-exports
pub use self::analyze::*;
pub use self::search::*;