Open petercsmith opened 9 years ago
Hi @petercsmith ,
Unless you specify a render function for records, fv2 will fall-back to its default result renderer which takes a configuration option to list some specific fields from the result record; that in turn just defaults to looking for a field called "id" to act as a kind of placeholder instead of the actual list you'd want to use. Since your data probably doesn't have an "id" field, it's just not rendering anything.
So, you have a couple of options.
1/ pass in your own renderer:
function customResultRenderer(options, record) {
return "string representation of record"
}
$(this).facetview({
search_url: 'http://services:9200/flow/_search',
render_result_record: customResultRenderer
debug: true
});
2/ Use the default renderer, and tell it which fields from your data to display:
$(this).facetview({
search_url: 'http://services:9200/flow/_search',
result_display : [
[ {"pre" : "<strong>EUID</strong>:", "field": "euid", "post" : "<br><br>"} ],
[ {"pre" : "<strong>Source Port</strong>:", "field": "srcPort", "post" : "<br><br>"} ]
[ {"pre" : "<strong>protocol</strong>:", "field": "protocol", "post" : "<br><br>"} ]
[ {"pre" : "<strong>action</strong>:", "field": "action", "post" : "<br><br>"} ]
],
debug: true
});
Hope that helps!
@richard-jones,
Thank you, that did the trick. I really appreciate your help!
Peter
I have facetview2 working against my ES index. The debug window shows results coming back from ES, but they refuse to display correctly in the results! The javascript debugger shows a bunch of empty 'td' tags, but I see results coming back from ES in the debugging console. See below for screenshot and code: