This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch add-milvus-rag-features in repository https://gitbox.apache.org/repos/asf/camel.git
commit 80c9560e2d566b2aa87bba4592f55732bfeaadab Author: Guillaume Nodet <[email protected]> AuthorDate: Thu Mar 19 06:59:03 2026 +0100 Add javadoc to Milvus helper classes - Add class-level javadoc to all 7 MilvusHelper* classes - Add @param javadoc to setters missing documentation Co-Authored-By: Claude Opus 4.6 <[email protected]> --- .../helpers/MilvusHelperCreateCollection.java | 28 ++++++++++++++++++++++ .../milvus/helpers/MilvusHelperCreateIndex.java | 13 ++++++++++ .../milvus/helpers/MilvusHelperDelete.java | 13 ++++++++++ .../milvus/helpers/MilvusHelperInsert.java | 16 +++++++++++++ .../helpers/MilvusHelperResultExtractor.java | 6 +++++ .../milvus/helpers/MilvusHelperSearch.java | 17 +++++++++++++ .../milvus/helpers/MilvusHelperUpsert.java | 16 +++++++++++++ 7 files changed, 109 insertions(+) diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java index 456f739b81b5..248fe089ed75 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateCollection.java @@ -24,6 +24,13 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.collection.CreateCollectionParam} and sets it as the + * exchange body, along with the {@link MilvusAction#CREATE_COLLECTION} action header. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperCreateCollection implements Processor { private String collectionName = "rag_collection"; @@ -93,6 +100,9 @@ public class MilvusHelperCreateCollection implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to create + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -101,6 +111,9 @@ public class MilvusHelperCreateCollection implements Processor { return collectionDescription; } + /** + * @param collectionDescription a human-readable description for the collection + */ public void setCollectionDescription(String collectionDescription) { this.collectionDescription = collectionDescription; } @@ -109,6 +122,9 @@ public class MilvusHelperCreateCollection implements Processor { return idFieldName; } + /** + * @param idFieldName the name of the auto-generated Int64 primary key field + */ public void setIdFieldName(String idFieldName) { this.idFieldName = idFieldName; } @@ -117,6 +133,9 @@ public class MilvusHelperCreateCollection implements Processor { return dimension; } + /** + * @param dimension the dimensionality of the float vector field (e.g., {@code 768}, {@code 1536}) + */ public void setDimension(String dimension) { this.dimension = dimension; } @@ -125,6 +144,9 @@ public class MilvusHelperCreateCollection implements Processor { return textFieldName; } + /** + * @param textFieldName the name of the primary text field in the collection + */ public void setTextFieldName(String textFieldName) { this.textFieldName = textFieldName; } @@ -145,6 +167,9 @@ public class MilvusHelperCreateCollection implements Processor { return vectorFieldName; } + /** + * @param vectorFieldName the name of the FloatVector field for embeddings + */ public void setVectorFieldName(String vectorFieldName) { this.vectorFieldName = vectorFieldName; } @@ -153,6 +178,9 @@ public class MilvusHelperCreateCollection implements Processor { return textFieldMaxLength; } + /** + * @param textFieldMaxLength the maximum length for VarChar text fields + */ public void setTextFieldMaxLength(String textFieldMaxLength) { this.textFieldMaxLength = textFieldMaxLength; } diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateIndex.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateIndex.java index 62dcf28357b0..794d39c22169 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateIndex.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperCreateIndex.java @@ -24,6 +24,13 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.index.CreateIndexParam} and sets it as the exchange + * body, along with the {@link MilvusAction#CREATE_INDEX} action header. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperCreateIndex implements Processor { private String collectionName = "rag_collection"; @@ -54,6 +61,9 @@ public class MilvusHelperCreateIndex implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to index + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -62,6 +72,9 @@ public class MilvusHelperCreateIndex implements Processor { return vectorFieldName; } + /** + * @param vectorFieldName the name of the vector field to index + */ public void setVectorFieldName(String vectorFieldName) { this.vectorFieldName = vectorFieldName; } diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperDelete.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperDelete.java index a4d83599f117..d5dd5a6d4b43 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperDelete.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperDelete.java @@ -22,6 +22,13 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.dml.DeleteParam} and sets it as the exchange body, + * along with the {@link MilvusAction#DELETE} action header. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperDelete implements Processor { private String collectionName = "rag_collection"; @@ -44,6 +51,9 @@ public class MilvusHelperDelete implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to delete from + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -52,6 +62,9 @@ public class MilvusHelperDelete implements Processor { return filter; } + /** + * @param filter a boolean expression to select entities to delete (e.g., {@code id > 100}) + */ public void setFilter(String filter) { this.filter = filter; } diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperInsert.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperInsert.java index 4b7a0f2b1fad..af7e9331c135 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperInsert.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperInsert.java @@ -26,6 +26,16 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.dml.InsertParam} from the exchange body (a + * {@code List<Float>} vector) and exchange variables, then sets it as the exchange body along with the + * {@link MilvusAction#INSERT} action header. + * <p> + * Text field values are read from exchange variables using the mappings defined in {@link #setTextFieldMappings}. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperInsert implements Processor { private String collectionName = "rag_collection"; @@ -62,6 +72,9 @@ public class MilvusHelperInsert implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to insert into + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -70,6 +83,9 @@ public class MilvusHelperInsert implements Processor { return vectorFieldName; } + /** + * @param vectorFieldName the name of the vector field in the collection + */ public void setVectorFieldName(String vectorFieldName) { this.vectorFieldName = vectorFieldName; } diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperResultExtractor.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperResultExtractor.java index 430e00e9b1a7..a53d471e28b3 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperResultExtractor.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperResultExtractor.java @@ -25,6 +25,12 @@ import io.milvus.param.highlevel.dml.response.SearchResponse; import io.milvus.response.QueryResultsWrapper; import org.apache.camel.Exchange; +/** + * A helper bean that extracts field values from a Milvus {@link io.milvus.param.highlevel.dml.response.SearchResponse} + * into a list of ranked maps. Each map contains a {@code rank} entry and the requested output field values. + * <p> + * Designed to be used as a bean in YAML DSL routes via its {@link #extract(Exchange)} method. + */ public class MilvusHelperResultExtractor { private String outputFields = "content"; diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperSearch.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperSearch.java index 8ff7260cca40..928bd27dde64 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperSearch.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperSearch.java @@ -26,6 +26,14 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.highlevel.dml.SearchSimpleParam} from the exchange + * body (a {@code List<Float>} query vector) and sets it as the exchange body, along with the + * {@link MilvusAction#SEARCH} action header. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperSearch implements Processor { private String collectionName = "rag_collection"; @@ -68,6 +76,9 @@ public class MilvusHelperSearch implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to search + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -88,6 +99,9 @@ public class MilvusHelperSearch implements Processor { return limit; } + /** + * @param limit the maximum number of results to return + */ public void setLimit(String limit) { this.limit = limit; } @@ -96,6 +110,9 @@ public class MilvusHelperSearch implements Processor { return filter; } + /** + * @param filter a boolean expression to filter search results (e.g., {@code age > 20}) + */ public void setFilter(String filter) { this.filter = filter; } diff --git a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperUpsert.java b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperUpsert.java index b112cfa33e65..57c19044488f 100644 --- a/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperUpsert.java +++ b/components/camel-ai/camel-milvus/src/main/java/org/apache/camel/component/milvus/helpers/MilvusHelperUpsert.java @@ -26,6 +26,16 @@ import org.apache.camel.Processor; import org.apache.camel.component.milvus.MilvusAction; import org.apache.camel.component.milvus.MilvusHeaders; +/** + * A {@link Processor} that builds a Milvus {@link io.milvus.param.dml.UpsertParam} from the exchange body (a + * {@code List<Float>} vector) and exchange variables, then sets it as the exchange body along with the + * {@link MilvusAction#UPSERT} action header. + * <p> + * Text field values are read from exchange variables using the mappings defined in {@link #setTextFieldMappings}. + * <p> + * Designed to be used as a bean in YAML DSL routes. All properties use {@code String} types for compatibility with + * Camel's property binding. + */ public class MilvusHelperUpsert implements Processor { private String collectionName = "rag_collection"; @@ -62,6 +72,9 @@ public class MilvusHelperUpsert implements Processor { return collectionName; } + /** + * @param collectionName the name of the Milvus collection to upsert into + */ public void setCollectionName(String collectionName) { this.collectionName = collectionName; } @@ -70,6 +83,9 @@ public class MilvusHelperUpsert implements Processor { return vectorFieldName; } + /** + * @param vectorFieldName the name of the vector field in the collection + */ public void setVectorFieldName(String vectorFieldName) { this.vectorFieldName = vectorFieldName; }
