Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:41:26+00:00 2026-06-13T16:41:26+00:00

<route> <from uri=direct:insert/> <setHeader headerName=SolrOperation> <constant>INSERT</constant> </setHeader> <setHeader headerName=SolrField.id> <simple>${body}</simple> </setHeader> <to uri=solr://localhost:8983/solr/> </route>

  • 0
<route>
    <from uri="direct:insert"/>
    <setHeader headerName="SolrOperation">
        <constant>INSERT</constant>
    </setHeader>
    <setHeader headerName="SolrField.id">
        <simple>${body}</simple>
    </setHeader>
    <to uri="solr://localhost:8983/solr"/>
</route>

This is sample code to set ${body} to a ‘id’ field, but since it supports message body as SolrInputDocument or equivalent XML, how am I suppose to do that in above XML route?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:41:27+00:00Added an answer on June 13, 2026 at 4:41 pm

    if you have the SolrInputDocument, then just pass it as the body of a message to the route and make sure the OPERATION header is set appropriately…

    //example producer code
    SolrInputDocument doc = new SolrInputDocument();
    doc.addField("id", "MA147LL/A", 1.0f);
    template.sendBodyAndHeader("direct:start", doc, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT);
    
    //simplified route that just expects the message body and OPERATION header are setup appropriately
    <from uri="direct:insert"/>
    <to uri="solr://localhost:8983/solr"/>
    

    see the unit tests for more information…

    https://svn.apache.org/repos/asf/camel/trunk/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrUpdateTest.java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to use this route: from(activemq:profiles).aggregate(header(cheese)).batchSize(30).bean(ProfilesQueueService, saveContacts) Fails with: No signature of method: org.apache.camel.model.RouteType.aggregate()
I want to route from controller to custom route I make a custom route
I have a custom routing application that takes information for a route from google
Is the route table available from the filters? I'm inheriting from the AuthorizeAtrribute class.
I need to check if a TCP/IP route already exists from my application and
import bottle from bottle import route, run @route('/', method='GET') def homepage(): return {'foo' :
Is there any standard way to route all Key events from the control A
I'm trying to draw a route in a mapView from the current location (got
new to Laravel (coming from Java spring), while using Route::get('/', function() { return Hello
I cannot get the following route to fire when a url is requested from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.