Hi Rafa, There was a problem with the conversion of the string to actual SolrQuery. I have fixed and committed it. Here is an example usage that I have tried,
> curl -i " http://localhost:8080/contenthub/contenthub/search/featured?solrQuery=q=paris%26facet=true%26facet.field=places_t " HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 612 Server: Jetty(6.1.x) { "documents": [{ "localid": "urn:content-item-sha1-d8cb233824c493e80d744a8120469e40be97444d", "mimetype": "text\/plain", "title": "paris", "enhancementcount": 4 }], "facets": [{ "facet": { "name": "places_t", "values": [ { "name": "Paris", "count": 1 }, { "name": "Paris, Texas", "count": 1 } ] }, "type": "string" }], "relatedkeywords": [{"paris": []}] } Thanks for reporting. Best, Meriç 2013/2/19 Rafa Haro <[email protected]> > Hi, > > I just wanted to share with the list an issue that I have faced working > with FeaturedSearch REST service within ContentHub. I have been developing > a Java Client for ContentHub services and I think that FeaturedSearch > RESTful API documentation should be clarified. Specifically, one of the > request parameters is a Solr query String. According to the documentation, > this parameter is " /the string format which is accepted by a Solr server. > For example, q="john doe"&fl=score" > > /The format of the example query is consistent with the String that you > get with SolrQuery.getQuery method in Solrj library and it's also > consistent with a Solr GET request URL query. The problem is that this > string seems not to be consistent with SolrQuerySintax [1], so, it is not a > valid String query for building a SolrQuery from the raw String with Solrj. > Correct me if I'm wrong, but I think that FeaturedSearch implementation is > directly building a SolrQuery from the solrQuery String parameter of the > service. > > I have done several tests with queries similar to the example query and I > never get the correct results. I also try to build SolrQuery queries with > Solrj programmatically and then pass SolrQuery.getQuery String as the > parameter of the service without success. In fact, I haven't been able to > find a way to convert a Solrj SolrQuery object to a well formed Solr String. > > Using a raw String consistent with SolrQuerySintax and passing it as the > solrQuery parameter is the only way I have find to get the correct results. > > I think that this issue is not a bug, but the documentation leads you to > think that you can use Solr URL like queries strings and, at least for me, > that's not working. > > [1] > http://wiki.apache.org/solr/**SolrQuerySyntax<http://wiki.apache.org/solr/SolrQuerySyntax> > > Regards > / > / > > -- > > ------------------------------ > This message should be regarded as confidential. If you have received this > email in error please notify the sender and destroy it immediately. > Statements of intent shall only become binding when confirmed in hard copy > by an authorised signatory. > > Zaizi Ltd is registered in England and Wales with the registration number > 6440931. The Registered Office is 222 Westbourne Studios, 242 Acklam Road, > London W10 5JJ, UK. >
