Ruth
Ruth

Reputation: 5816

Solr - return field value as JSON

Take for example

{'name':'Ruth', 'age':28, 'city':'madrid'}

This JSON gets indexed and is stored as a string. Is there a way to return this field value as JSON in the response?

Upvotes: 0

Views: 282

Answers (2)

Ruth
Ruth

Reputation: 5816

I came across this which did what I want

https://issues.apache.org/jira/browse/SOLR-1690

Upvotes: 0

Allan Macmillan
Allan Macmillan

Reputation: 1491

Add &wt=json at the end of your query to get Solr to return a response in JSON format. XML is default. For example:

http://localhost:8080/solr/select?q=*&wt=json

Upvotes: 1

Related Questions