14
14
// You should have received a copy of the GNU Affero General Public License
15
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
16
17
+ //! # Main flow
18
+ //! ```md
19
+ //! `coordinator` <------> `searcher`
20
+ //! -----------------------------------
21
+ //! send query to searcher
22
+ //! search index
23
+ //! collect fruits
24
+ //! send fruits to coordinator
25
+ //! merge fruits
26
+ //! filter fruits
27
+ //! for each shard
28
+ //! send fruits to searchers
29
+ //! construct intermediate output
30
+ //! from fruits
31
+ //! send intermediate output to coordinator
32
+ //! merge intermediate outputs
33
+ //! return final output
34
+ //! ---------------------------------------------------
35
+ //! ```
36
+
17
37
use crate :: { inverted_index:: ShardId , search_ctx, Result } ;
18
38
19
39
pub mod top_key_phrases;
@@ -34,6 +54,8 @@ pub use get_site_urls::GetSiteUrlsQuery;
34
54
pub mod collector;
35
55
pub use collector:: Collector ;
36
56
57
+ /// A generic query that can be executed on a searcher
58
+ /// against an index.
37
59
pub trait GenericQuery : Send + Sync + bincode:: Encode + bincode:: Decode + Clone {
38
60
type Collector : Collector ;
39
61
type TantivyQuery : tantivy:: query:: Query ;
@@ -42,7 +64,7 @@ pub trait GenericQuery: Send + Sync + bincode::Encode + bincode::Decode + Clone
42
64
43
65
fn tantivy_query ( & self , ctx : & search_ctx:: Ctx ) -> Self :: TantivyQuery ;
44
66
fn collector ( & self , ctx : & search_ctx:: Ctx ) -> Self :: Collector ;
45
- fn remote_collector ( & self ) -> Self :: Collector ;
67
+ fn coordinator_collector ( & self ) -> Self :: Collector ;
46
68
47
69
fn filter_fruit_shards (
48
70
& self ,
0 commit comments