Hi Meric,

Thanks for the patch. I have applied it and I can see the filled facets
field in the search results now.

Best,
Suat

On 2/1/2013 11:20 PM, MeriƧ Taze wrote:
> Hello,
>
> Yes, you are right. We must return facets in json response like in the html
> response. I opened an issue[1], and
> I am going to add a patch. If you want you can use it or wait for the
> commit on Monday. BTW, thanks for reporting.
>
> Best,
> Meric.
>
> [1] https://issues.apache.org/jira/browse/STANBOL-907
>
>
> 2013/2/1 Rafa Haro <rh...@zaizi.com>
>
>> Hi all,
>>
>> I'm currently working on extend our (a little old) Stanbol java client [1]
>> to fully support EntityHub and ContentHub services. I'm facing a weird
>> problem with ContentHub Featured Search REST service [2]. I was trying to
>> get the results in JSON, but it seems that the only way to do it is only
>> accepting text/html. I have tested it with curl, with only one document
>> about Paris:
>>
>> With /curl -i  -H "Accept:application/json" "http://192.168.1.21:8080/**
>> contenthub/contenthub/search/**featured?queryTerm=paris<http://192.168.1.21:8080/contenthub/contenthub/search/featured?queryTerm=paris>"/
>> the server returns this response:
>>
>> {
>>     "documents": [{
>>         "localid": "urn:content-item-sha1-**8a8643d8c42d6c3d36aeffb1f76981
>> **26d30a014f",
>>         "mimetype": "text\/plain",
>>         "title": "Paris",
>>         "enhancementcount": 24
>>     }],
>>     "facets": [],
>>     "relatedkeywords": [{"paris": []}]
>>
>> As you can see, any facet is returned. If you pass Accept:text/html in the
>> header, now it's is possible to get facets and HTML+javascript to use them:
>>
>> /curl -i  -H "Accept:text/html" "http://192.168.1.21:8080/**
>> contenthub/contenthub/search/**featured?queryTerm=paris<http://192.168.1.21:8080/contenthub/contenthub/search/featured?queryTerm=paris>
>> "/
>>
>> I suppose that the facets should be also in JSON response. Am I wrong?
>>
>> Thanks!
>>
>> [1] - 
>> https://github.com/zaizi/**apache-stanbol-client<https://github.com/zaizi/apache-stanbol-client>
>> [2] - http://dev.iks-project.eu:**8081/contenthub/contenthub/**
>> search/featured<http://dev.iks-project.eu:8081/contenthub/contenthub/search/featured>
>>
>> --
>>
>> ------------------------------
>> 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.
>>

Reply via email to