Specify a method for requesting resources by solr query?


Has anyone come up with a way to specify solr query strings with RAML?

What’s the most efficient way to do that?


It shouldn’t be too hard to model in RAML. Do you mean something like this example?


Thanks! Sorry, I basically meant how to indicate “this resource will take a solr query string”, i.e. any solr query is valid. I will take a look to see if I can wrap my head around the example you sent. A RAML example would be great too!


You can describe pretty much any kind or query parameter in RAML.


curl 'http://localhost:8983/solr/techproducts/query?json.limit=5&json.filter="cat:electronics"' -d '
  query: "memory",
  limit: 10,
  filter: "inStock:true"

could look something like this:

#%RAML 1.0 Library
          limit: integer
            pattern: '^\w+:\w+$'


@jstoiko - yes, now I get it. This is much simpler than I thought. So the solr query syntax is JSON friendly and you just need to note e.g. a JSON param for any solr-friendly methods?


yes, you can model it the way you want