You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/10/22 19:13:00 UTC

[jira] [Work started] (CAMEL-26026) camel-solr - the type of the body overrides the operation of the CamelSolrOperation header and the operation option

     [ https://issues.apache.org/jira/browse/CAMEL-26026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-26026 started by Claus Ibsen.
-------------------------------------------
> camel-solr - the type of the body overrides the operation of the CamelSolrOperation header and the operation option
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26026
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26026
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-solr
>    Affects Versions: 4.18.0, 4.22.0, 4.23.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.18.6, 4.22.3, 4.24.0
>
>
> The solr producer picks the operation from the type of the body before it looks at the {{CamelSolrOperation}} header and the {{operation}} option ({{SolrProducer.resolveSolrOperation}}, main 07d2e7a987bc, lines 177-238): a Map, a File or a Collection that is not all Strings runs an INSERT, and a Collection of Strings runs a DELETE by id. So the operation of a route depends on the shape of its data: a route with {{operation=INSERT}} deletes documents when the body is a List of Strings, and one with {{operation=SEARCH}} inserts a Map body. The {{CamelSolrQueryString}} header makes any operation a SEARCH, and a {{CamelSolrOperation}} value that is not an operation does not fail.
> Checked on 4.24.0-SNAPSHOT with {{camel run}} against {{camel infra run solr}}:
> * {{operation=INSERT}} with the body {{["maps-1"]}} deleted the document maps-1;
> * {{operation=SEARCH}} with a Map body inserted the Map as a document;
> * {{operation=PING}} with a List of Strings deleted the documents with those ids;
> * {{CamelSolrOperation=NOSUCH}} on an endpoint with {{operation=INSERT}} ran a search.
> *Proposed change*: the {{CamelSolrOperation}} header, or else the {{operation}} option, decides the operation, and the body only when neither is set. A body that is a SolrJ request, such as a SolrQuery or an UpdateRequest, still picks its own operation, as the route builds it. A header value that is not an operation fails.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)