ryerraguntla commented on code in PR #3498:
URL: https://github.com/apache/iggy/pull/3498#discussion_r3424554760


##########
core/connectors/sources/meilisearch_source/src/lib.rs:
##########
@@ -0,0 +1,738 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use async_trait::async_trait;
+use iggy_connector_sdk::{
+    ConnectorState, Error, ProducedMessage, ProducedMessages, Schema, Source,
+    retry::{exponential_backoff, jitter, parse_duration},
+    source_connector,
+};
+use meilisearch_sdk::{
+    client::Client,
+    errors::{
+        Error as MeilisearchSdkError, ErrorCode as MeilisearchErrorCode,
+        ErrorType as MeilisearchErrorType,
+    },
+};
+use secrecy::{ExposeSecret, SecretString};
+use serde::{Deserialize, Serialize};
+use serde_json::{Value, json};
+use std::{future::Future, time::Duration};
+use tokio::{sync::Mutex, time::sleep};
+use tracing::{info, warn};
+
+source_connector!(MeilisearchSource);
+
+const CONNECTOR_NAME: &str = "Meilisearch source";
+const DEFAULT_BATCH_SIZE: usize = 100;
+const DEFAULT_POLLING_INTERVAL: &str = "5s";
+const DEFAULT_INCLUDE_METADATA: bool = false;
+const DEFAULT_TIMEOUT: &str = "30s";
+const DEFAULT_RETRY_DELAY: &str = "500ms";
+const DEFAULT_MAX_RETRY_DELAY: &str = "5s";
+const DEFAULT_MAX_RETRIES: u32 = 3;
+const DEFAULT_MAX_OPEN_RETRIES: u32 = 5;
+const PRIMARY_KEY_SORT_DIRECTION: &str = "asc";
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct MeilisearchSourceConfig {
+    pub url: String,
+    pub index: String,
+    #[serde(serialize_with = 
"iggy_common::serde_secret::serialize_optional_secret")]
+    pub api_key: Option<SecretString>,
+    pub query: Option<String>,

Review Comment:
   58 — filter: Option<Value> accepts any JSON type; type errors (e.g. filter: 
{"foo": "bar"}) pass From<> conversion and first open(), then surface as 
Error::InvalidConfigValue on first poll.
     **Fix: validate filter shape in open() rather than per-poll in 
filter_expression(). (raised: ecosystem; one agent, but verifiable — 
filter_expression() at line 255 is called every search_documents with no 
earlier  gate)**



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to