Skip to content

Instantly share code, notes, and snippets.

@tomgullo
Last active December 15, 2015 10:38
Show Gist options
  • Save tomgullo/5246656 to your computer and use it in GitHub Desktop.
Save tomgullo/5246656 to your computer and use it in GitHub Desktop.
json_from_solr.groovy
def data = new URL(s).text
json = slurper.parseText(data)
json.response.docs
json.highlighting
json.facet_counts
json.responseHeader.QTime
json.response.numFound
for (e in docs) {
String id_s = e.id.toString()
if (id_s) {
if (highlighting[id_s].field_with_text) {
e.field_with_text = highlighting[id_s].field_with_text.join("")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment