Hi all,
So I'm trying to hit solr through camel and in the url there needs to be some pluses. Specifically to specify time facet gap "/HOUR+1HOUR". From googling I haven't seen any talk of this problem yet. I've tried java.util.URLEncoder and Decoder in numerous places inside and outside of the route to no avail.
For example in the REPL:

import org.apache.camel.impl.DefaultCamelContext
import org.apache.camel.scala.dsl.builder.RouteBuilder
val ctx = new DefaultCamelContext()
val rs =
    new RouteBuilder {
      from("direct:thing") ==> {
        recipients(e => e.in[String])
        to("log:debug?showAll=true")
      }
}
ctx.addRoutes(rs)
ctx.start()
ctx.createProducerTemplate().requestBody("direct:thing", "http://localhost:8080/solr/select?q=*:*&facet.range=datetime&f.datetime.facet.range.start=2010-01-01T00%3A00%3A00.000Z&f.datetime.facet.range.end=2010-01-10T00%3A00%3A00.000Z&f.datetime.facet.range.gap=%2FDAY%2B1DAY&facet=true&facet.limit=10&facet.mincount=1";)

or really any address where you get a 400 error and can see in the message getting passed in is still %2B but then in the from the HTTPException that it has changed to a +.

Caused by: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8080/solr/select?f.datetime.facet.range.end=2010-01-10T00%3A00%3A00.000Z&f.datetime.facet.range.gap=%2FDAY+1DAY&f.datetime.facet.range.start=2010-01-01T00%3A00%3A00.000Z&facet=true&facet.limit=10&facet.mincount=1&facet.range=datetime&q=*%3A* with statusCode: 400 at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:228) at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:156) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

Thanks for any help,
Joseph


Using scala 2.10.0
Camel 2.11.0
Java 7

Reply via email to