quickwit-proto 0.3.0

Quickwit's protos
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
// -- Search -------------------

#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchRequest {
    /// Index ID
    #[prost(string, tag="1")]
    pub index_id: ::prost::alloc::string::String,
    /// Query
    #[prost(string, tag="2")]
    pub query: ::prost::alloc::string::String,
    /// Fields to search on
    #[prost(string, repeated, tag="3")]
    pub search_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Time filter
    #[prost(int64, optional, tag="4")]
    pub start_timestamp: ::core::option::Option<i64>,
    #[prost(int64, optional, tag="5")]
    pub end_timestamp: ::core::option::Option<i64>,
    /// Maximum number of hits to return.
    #[prost(uint64, tag="6")]
    pub max_hits: u64,
    /// First hit to return. Together with max_hits, this parameter
    /// can be used for pagination.
    ///
    /// E.g.
    /// The results with rank [start_offset..start_offset + max_hits) are returned.
    #[prost(uint64, tag="7")]
    pub start_offset: u64,
    /// Sort order
    #[prost(enumeration="SortOrder", optional, tag="9")]
    pub sort_order: ::core::option::Option<i32>,
    /// Sort by fast field. If unset sort by docid
    #[prost(string, optional, tag="10")]
    pub sort_by_field: ::core::option::Option<::prost::alloc::string::String>,
    /// json serialized aggregation_request
    #[prost(string, optional, tag="11")]
    pub aggregation_request: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResponse {
    /// Number of hits matching the query.
    #[prost(uint64, tag="1")]
    pub num_hits: u64,
    /// Matched hits
    #[prost(message, repeated, tag="2")]
    pub hits: ::prost::alloc::vec::Vec<Hit>,
    /// Elapsed time to perform the request. This time is measured
    /// server-side and expressed in microseconds.
    #[prost(uint64, tag="3")]
    pub elapsed_time_micros: u64,
    /// The searcherrors that occured formatted as string.
    #[prost(string, repeated, tag="4")]
    pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Serialized aggregation response
    #[prost(string, optional, tag="5")]
    pub aggregation: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitSearchError {
    /// The searcherror that occured formatted as string.
    #[prost(string, tag="1")]
    pub error: ::prost::alloc::string::String,
    /// Split id that failed.
    #[prost(string, tag="2")]
    pub split_id: ::prost::alloc::string::String,
    /// Flag to indicate if the error can be considered a retryable error
    #[prost(bool, tag="3")]
    pub retryable_error: bool,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafSearchRequest {
    /// Search request. This is a perfect copy of the original search request,
    /// that was sent to root apart from the start_offset & max_hits params.
    #[prost(message, optional, tag="1")]
    pub search_request: ::core::option::Option<SearchRequest>,
    /// Index split ids to apply the query on.
    /// This ids are resolved from the index_uri defined in the search_request.
    #[prost(message, repeated, tag="4")]
    pub split_offsets: ::prost::alloc::vec::Vec<SplitIdAndFooterOffsets>,
    /// `DocMapper` as json serialized trait.
    #[prost(string, tag="5")]
    pub doc_mapper: ::prost::alloc::string::String,
    /// Index URI. The index URI defines the location of the storage that contains the
    /// split files.
    #[prost(string, tag="6")]
    pub index_uri: ::prost::alloc::string::String,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitIdAndFooterOffsets {
    /// Index split id to apply the query on.
    /// This id is resolved from the index_uri defined in the search_request.
    #[prost(string, tag="1")]
    pub split_id: ::prost::alloc::string::String,
    /// The offset of the start of footer in the split bundle. The footer contains the file bundle metadata and the hotcache.
    #[prost(uint64, tag="2")]
    pub split_footer_start: u64,
    /// The offset of the end of the footer in split bundle. The footer contains the file bundle metada and the hotcache.
    #[prost(uint64, tag="3")]
    pub split_footer_end: u64,
}
//// Hits returned by a FetchDocRequest.
////
//// The json that is joined is the raw tantivy json doc.
//// It is very different from a quickwit json doc.
////
//// For instance:
//// - it may contain a _source and a _dynamic field.
//// - since tantivy has no notion of cardinality,
//// all fields is  are arrays.
//// - since tantivy has no notion of object, the object is
//// flattened by concatenating the path to the root.
////
//// See  `quickwit_search::convert_leaf_hit`
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafHit {
    /// The actual content of the hit/
    #[prost(string, tag="1")]
    pub leaf_json: ::prost::alloc::string::String,
    /// The partial hit (ie: the sorting field + the document address)
    #[prost(message, optional, tag="2")]
    pub partial_hit: ::core::option::Option<PartialHit>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hit {
    /// The actual content of the hit/
    #[prost(string, tag="1")]
    pub json: ::prost::alloc::string::String,
    /// The partial hit (ie: the sorting field + the document address)
    #[prost(message, optional, tag="2")]
    pub partial_hit: ::core::option::Option<PartialHit>,
}
/// A partial hit, is a hit for which we have not fetch the content yet.
/// Instead, it holds a document_uri which is enough information to
/// go and fetch the actual document data, by performing a `get_doc(...)`
/// request.
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PartialHit {
    /// Sorting field value. (e.g. timestamp)
    ///
    /// Quickwit only computes top-K of this sorting field.
    /// If the user requested for a bottom-K of a given fast field, then quickwit simply
    /// emits an decreasing mapping of this fast field.
    ///
    /// In case of a tie, quickwit uses the increasing order of
    /// - the split_id,
    /// - the segment_ord,
    /// - the doc id.
    #[prost(uint64, tag="1")]
    pub sorting_field_value: u64,
    #[prost(string, tag="2")]
    pub split_id: ::prost::alloc::string::String,
    /// (segment_ord, doc) form a tantivy DocAddress, which is sufficient to identify a document
    /// within a split
    #[prost(uint32, tag="3")]
    pub segment_ord: u32,
    /// The DocId identifies a unique document at the scale of a tantivy segment.
    #[prost(uint32, tag="4")]
    pub doc_id: u32,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafSearchResponse {
    /// Total number of documents matched by the query.
    #[prost(uint64, tag="1")]
    pub num_hits: u64,
    /// List of the best top-K candidates for the given leaf query.
    #[prost(message, repeated, tag="2")]
    pub partial_hits: ::prost::alloc::vec::Vec<PartialHit>,
    /// The list of splits that failed. LeafSearchResponse can be an aggregation of results, so there may be multiple.
    #[prost(message, repeated, tag="3")]
    pub failed_splits: ::prost::alloc::vec::Vec<SplitSearchError>,
    /// Total number of splits the leaf(s) were in charge of.
    /// num_attempted_splits = num_successful_splits + num_failed_splits.
    #[prost(uint64, tag="4")]
    pub num_attempted_splits: u64,
    /// json serialized intermediate aggregation_result.
    #[prost(string, optional, tag="5")]
    pub intermediate_aggregation_result: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchDocsRequest {
    /// Request fetching the content of a given list of partial_hits.
    #[prost(message, repeated, tag="1")]
    pub partial_hits: ::prost::alloc::vec::Vec<PartialHit>,
    /// Index ID
    #[prost(string, tag="2")]
    pub index_id: ::prost::alloc::string::String,
    /// Split footer offsets. They are required for fetch docs to
    /// fetch the document content in two reads, when the footer is not
    /// cached.
    #[prost(message, repeated, tag="3")]
    pub split_offsets: ::prost::alloc::vec::Vec<SplitIdAndFooterOffsets>,
    /// Index URI. The index URI defines the location of the storage that contains the
    /// split files.
    #[prost(string, tag="4")]
    pub index_uri: ::prost::alloc::string::String,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchDocsResponse {
    /// List of complete hits.
    #[prost(message, repeated, tag="1")]
    pub hits: ::prost::alloc::vec::Vec<LeafHit>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchStreamRequest {
    /// Index ID
    #[prost(string, tag="1")]
    pub index_id: ::prost::alloc::string::String,
    /// Query
    #[prost(string, tag="2")]
    pub query: ::prost::alloc::string::String,
    /// Fields to search on
    #[prost(string, repeated, tag="3")]
    pub search_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The time filter is interpreted as a semi-open interval. [start, end)
    #[prost(int64, optional, tag="4")]
    pub start_timestamp: ::core::option::Option<i64>,
    #[prost(int64, optional, tag="5")]
    pub end_timestamp: ::core::option::Option<i64>,
    /// Name of the fast field to extract
    #[prost(string, tag="6")]
    pub fast_field: ::prost::alloc::string::String,
    /// The output format
    #[prost(enumeration="OutputFormat", tag="7")]
    pub output_format: i32,
    /// The field by which we want to partition
    #[prost(string, optional, tag="9")]
    pub partition_by_field: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafSearchStreamRequest {
    /// Stream request. This is a perfect copy of the original stream request,
    /// that was sent to root.
    #[prost(message, optional, tag="1")]
    pub request: ::core::option::Option<SearchStreamRequest>,
    /// Index split ids to apply the query on.
    /// This ids are resolved from the index_uri defined in the stream request.
    #[prost(message, repeated, tag="2")]
    pub split_offsets: ::prost::alloc::vec::Vec<SplitIdAndFooterOffsets>,
    /// `DocMapper` as json serialized trait.
    #[prost(string, tag="5")]
    pub doc_mapper: ::prost::alloc::string::String,
    /// Index URI. The index URI defines the location of the storage that contains the
    /// split files.
    #[prost(string, tag="6")]
    pub index_uri: ::prost::alloc::string::String,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafSearchStreamResponse {
    /// Row of data serialized in bytes.
    #[prost(bytes="vec", tag="1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// Split id.
    #[prost(string, tag="2")]
    pub split_id: ::prost::alloc::string::String,
}
#[derive(Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SortOrder {
    //// Ascending order.
    Asc = 0,
    //// Descending order.
    ///
    ///< This will be the default value;
    Desc = 1,
}
// -- Stream -------------------

#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OutputFormat {
    //// Comma Separated Values format (<https://datatracker.ietf.org/doc/html/rfc4180>).
    //// The delimiter is `,`.
    ///
    ///< This will be the default value
    Csv = 0,
    //// Format data by row in ClickHouse binary format.
    //// <https://clickhouse.tech/docs/en/interfaces/formats/#rowbinary>
    ClickHouseRowBinary = 1,
}
/// Generated client implementations.
pub mod search_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    #[derive(Debug, Clone)]
    pub struct SearchServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl SearchServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> SearchServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> SearchServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            SearchServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with `gzip`.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_gzip(mut self) -> Self {
            self.inner = self.inner.send_gzip();
            self
        }
        /// Enable decompressing responses with `gzip`.
        #[must_use]
        pub fn accept_gzip(mut self) -> Self {
            self.inner = self.inner.accept_gzip();
            self
        }
        /// Root search API.
        /// This RPC identifies the set of splits on which the query should run on,
        /// and dispatch the several calls to `LeafSearch`.
        ///
        /// It is also in charge of merging back the results.
        pub async fn root_search(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchRequest>,
        ) -> Result<tonic::Response<super::SearchResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/quickwit.SearchService/RootSearch",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        /// Perform a leaf search on a given set of splits.
        ///
        /// It is like a regular search except that:
        /// - the node should perform the search locally instead of dispatching
        /// it to other nodes.
        /// - it should be applied on the given subset of splits
        /// - Hit content is not fetched, and we instead return so called `PartialHit`.
        pub async fn leaf_search(
            &mut self,
            request: impl tonic::IntoRequest<super::LeafSearchRequest>,
        ) -> Result<tonic::Response<super::LeafSearchResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/quickwit.SearchService/LeafSearch",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        //// Fetches the documents contents from the document store.
        //// This methods takes `PartialHit`s and returns `Hit`s.
        pub async fn fetch_docs(
            &mut self,
            request: impl tonic::IntoRequest<super::FetchDocsRequest>,
        ) -> Result<tonic::Response<super::FetchDocsResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/quickwit.SearchService/FetchDocs",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        /// Perform a leaf stream on a given set of splits.
        pub async fn leaf_search_stream(
            &mut self,
            request: impl tonic::IntoRequest<super::LeafSearchStreamRequest>,
        ) -> Result<
                tonic::Response<
                    tonic::codec::Streaming<super::LeafSearchStreamResponse>,
                >,
                tonic::Status,
            > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/quickwit.SearchService/LeafSearchStream",
            );
            self.inner.server_streaming(request.into_request(), path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod search_service_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    ///Generated trait containing gRPC methods that should be implemented for use with SearchServiceServer.
    #[async_trait]
    pub trait SearchService: Send + Sync + 'static {
        /// Root search API.
        /// This RPC identifies the set of splits on which the query should run on,
        /// and dispatch the several calls to `LeafSearch`.
        ///
        /// It is also in charge of merging back the results.
        async fn root_search(
            &self,
            request: tonic::Request<super::SearchRequest>,
        ) -> Result<tonic::Response<super::SearchResponse>, tonic::Status>;
        /// Perform a leaf search on a given set of splits.
        ///
        /// It is like a regular search except that:
        /// - the node should perform the search locally instead of dispatching
        /// it to other nodes.
        /// - it should be applied on the given subset of splits
        /// - Hit content is not fetched, and we instead return so called `PartialHit`.
        async fn leaf_search(
            &self,
            request: tonic::Request<super::LeafSearchRequest>,
        ) -> Result<tonic::Response<super::LeafSearchResponse>, tonic::Status>;
        //// Fetches the documents contents from the document store.
        //// This methods takes `PartialHit`s and returns `Hit`s.
        async fn fetch_docs(
            &self,
            request: tonic::Request<super::FetchDocsRequest>,
        ) -> Result<tonic::Response<super::FetchDocsResponse>, tonic::Status>;
        ///Server streaming response type for the LeafSearchStream method.
        type LeafSearchStreamStream: futures_core::Stream<
                Item = Result<super::LeafSearchStreamResponse, tonic::Status>,
            >
            + Send
            + 'static;
        /// Perform a leaf stream on a given set of splits.
        async fn leaf_search_stream(
            &self,
            request: tonic::Request<super::LeafSearchStreamRequest>,
        ) -> Result<tonic::Response<Self::LeafSearchStreamStream>, tonic::Status>;
    }
    #[derive(Debug)]
    pub struct SearchServiceServer<T: SearchService> {
        inner: _Inner<T>,
        accept_compression_encodings: (),
        send_compression_encodings: (),
    }
    struct _Inner<T>(Arc<T>);
    impl<T: SearchService> SearchServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for SearchServiceServer<T>
    where
        T: SearchService,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/quickwit.SearchService/RootSearch" => {
                    #[allow(non_camel_case_types)]
                    struct RootSearchSvc<T: SearchService>(pub Arc<T>);
                    impl<
                        T: SearchService,
                    > tonic::server::UnaryService<super::SearchRequest>
                    for RootSearchSvc<T> {
                        type Response = super::SearchResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SearchRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).root_search(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = RootSearchSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/quickwit.SearchService/LeafSearch" => {
                    #[allow(non_camel_case_types)]
                    struct LeafSearchSvc<T: SearchService>(pub Arc<T>);
                    impl<
                        T: SearchService,
                    > tonic::server::UnaryService<super::LeafSearchRequest>
                    for LeafSearchSvc<T> {
                        type Response = super::LeafSearchResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::LeafSearchRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).leaf_search(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = LeafSearchSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/quickwit.SearchService/FetchDocs" => {
                    #[allow(non_camel_case_types)]
                    struct FetchDocsSvc<T: SearchService>(pub Arc<T>);
                    impl<
                        T: SearchService,
                    > tonic::server::UnaryService<super::FetchDocsRequest>
                    for FetchDocsSvc<T> {
                        type Response = super::FetchDocsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::FetchDocsRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).fetch_docs(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = FetchDocsSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/quickwit.SearchService/LeafSearchStream" => {
                    #[allow(non_camel_case_types)]
                    struct LeafSearchStreamSvc<T: SearchService>(pub Arc<T>);
                    impl<
                        T: SearchService,
                    > tonic::server::ServerStreamingService<
                        super::LeafSearchStreamRequest,
                    > for LeafSearchStreamSvc<T> {
                        type Response = super::LeafSearchStreamResponse;
                        type ResponseStream = T::LeafSearchStreamStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::LeafSearchStreamRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move {
                                (*inner).leaf_search_stream(request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = LeafSearchStreamSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: SearchService> Clone for SearchServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
            }
        }
    }
    impl<T: SearchService> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(self.0.clone())
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: SearchService> tonic::transport::NamedService for SearchServiceServer<T> {
        const NAME: &'static str = "quickwit.SearchService";
    }
}