The main logic of the library: splitting a set of 5 results into a neatly ordered array, to be able to display it as two columns in Hogan.
175 lines
3.5 KiB
JSON
175 lines
3.5 KiB
JSON
[
|
|
{
|
|
"hierarchy": {
|
|
"lvl0": "Ruby",
|
|
"lvl1": "API",
|
|
"lvl2": "Search",
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": "Search with Ruby API",
|
|
"_snippetResult": {
|
|
"content": {
|
|
"value": "<mark>Search</mark> with Ruby API"
|
|
}
|
|
},
|
|
"_highlightResult": {
|
|
"hierarchy": {
|
|
"lvl0": {
|
|
"value": "Ruby"
|
|
},
|
|
"lvl1": {
|
|
"value": "API"
|
|
},
|
|
"lvl2": {
|
|
"value": "Search"
|
|
},
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": {
|
|
"value": "<mark>Search</mark> with Ruby API"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"hierarchy": {
|
|
"lvl0": "PHP",
|
|
"lvl1": "Wordpress",
|
|
"lvl2": "Indexing",
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": "Indexing in Wordpress with PHP",
|
|
"_snippetResult": {
|
|
"content": {
|
|
"value": "<mark>Indexing</mark> in Wordpress with PHP"
|
|
}
|
|
},
|
|
"_highlightResult": {
|
|
"hierarchy": {
|
|
"lvl0": {
|
|
"value": "PHP"
|
|
},
|
|
"lvl1": {
|
|
"value": "Wordpress"
|
|
},
|
|
"lvl2": {
|
|
"value": "<mark>Indexing</mark>"
|
|
},
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": {
|
|
"value": "<mark>Indexing</mark> in Wordpress with PHP"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"hierarchy": {
|
|
"lvl0": "Go",
|
|
"lvl1": "API",
|
|
"lvl2": "Geosearch",
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": "Doing geosearch with the API in Go",
|
|
"_snippetResult": {
|
|
"content": {
|
|
"value": "Doing <mark>geosearch</mark> with the API in Go"
|
|
}
|
|
},
|
|
"_highlightResult": {
|
|
"hierarchy": {
|
|
"lvl0": {
|
|
"value": "Go"
|
|
},
|
|
"lvl1": {
|
|
"value": "API"
|
|
},
|
|
"lvl2": {
|
|
"value": "<mark>Geosearch</mark>"
|
|
},
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": {
|
|
"value": "Doing <mark>geosearch</mark> with the API in Go"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"hierarchy": {
|
|
"lvl0": "Ruby",
|
|
"lvl1": "API",
|
|
"lvl2": "Geosearch",
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": "Doing geosearch with the API in Ruby",
|
|
"_snippetResult": {
|
|
"content": {
|
|
"value": "Doing <mark>geosearch</mark> with the API in Ruby"
|
|
}
|
|
},
|
|
"_highlightResult": {
|
|
"hierarchy": {
|
|
"lvl0": {
|
|
"value": "Ruby"
|
|
},
|
|
"lvl1": {
|
|
"value": "API"
|
|
},
|
|
"lvl2": {
|
|
"value": "<mark>Geosearch</mark>"
|
|
},
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": {
|
|
"value": "Doing <mark>geosearch</mark> with the API in Ruby"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"hierarchy": {
|
|
"lvl0": "PHP",
|
|
"lvl1": "Magento",
|
|
"lvl2": null,
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": "Searching in Magento with PHP",
|
|
"_snippetResult": {
|
|
"content": {
|
|
"value": "Searching in <mark>Magento</mark> with PHP"
|
|
}
|
|
},
|
|
"_highlightResult": {
|
|
"hierarchy": {
|
|
"lvl0": {
|
|
"value": "PHP"
|
|
},
|
|
"lvl1": {
|
|
"value": "Magento"
|
|
},
|
|
"lvl2": null,
|
|
"lvl3": null,
|
|
"lvl4": null,
|
|
"lvl5": null
|
|
},
|
|
"content": {
|
|
"value": "Searching in <mark>Magento</mark> with PHP"
|
|
}
|
|
}
|
|
}
|
|
]
|