Skip to content

Commit

Permalink
Removing search/ingest specific client building method. (#4125)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Nov 13, 2023
1 parent de8eb9c commit 41f4bd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
4 changes: 2 additions & 2 deletions quickwit/quickwit-cli/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ pub async fn ingest_docs_cli(args: IngestDocsArgs) -> anyhow::Result<()> {
progress_bar.set_message(format!("{throughput:.1} MiB/s"));
};

let qw_client = args.client_args.ingest_client();
let qw_client = args.client_args.client();
let ingest_source = match args.input_path_opt {
Some(filepath) => IngestSource::File(filepath),
None => IngestSource::Stdin,
Expand Down Expand Up @@ -862,7 +862,7 @@ pub async fn search_index(args: SearchIndexArgs) -> anyhow::Result<SearchRespons
count_all: CountHits::CountAll,
..Default::default()
};
let qw_client = args.client_args.search_client();
let qw_client = args.client_args.client();
let search_response = qw_client.search(&args.index_id, search_request).await?;
Ok(search_response)
}
Expand Down
23 changes: 0 additions & 23 deletions quickwit/quickwit-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,7 @@ impl ClientArgs {
}
if let Some(timeout) = self.timeout {
builder = builder.timeout(timeout);
}
if self.ingest_v2 {
builder = builder.enable_ingest_v2();
}
builder.build()
}

pub fn search_client(self) -> QuickwitClient {
let mut builder = QuickwitClientBuilder::new(self.cluster_endpoint);
if let Some(connect_timeout) = self.connect_timeout {
builder = builder.connect_timeout(connect_timeout);
}
if let Some(timeout) = self.timeout {
builder = builder.search_timeout(timeout);
}
builder.build()
}

pub fn ingest_client(self) -> QuickwitClient {
let mut builder = QuickwitClientBuilder::new(self.cluster_endpoint);
if let Some(connect_timeout) = self.connect_timeout {
builder = builder.connect_timeout(connect_timeout);
}
if let Some(timeout) = self.timeout {
builder = builder.ingest_timeout(timeout);
}
if let Some(commit_timeout) = self.commit_timeout {
Expand Down

0 comments on commit 41f4bd5

Please sign in to comment.