From 01db4905a49dda936297690d7aa5747fd1a378b1 Mon Sep 17 00:00:00 2001 From: Evaldas Buinauskas Date: Mon, 20 Nov 2023 11:54:28 +0200 Subject: [PATCH] Fix clippy::needless_doctest_main lint --- src/lib.rs | 54 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index edba7bc..2d8ccfb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,34 +27,32 @@ //! ```rust //! use elasticsearch_dsl::*; //! -//! fn main() { -//! 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)); -//! } +//! 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.