Ok so I have successfully done this with solr!
This is probably obvious to all expert nodebb people here, but for me I had to really look at the source code/docs/google to understand how the eco system works.
After configuring the nodebb-plugin-solr
the api call out of the box looks like /api/search/KEYWORD?in=titlespost
I am still trying to figure out how the plugin is hooked up with the core and how this route triggers the solr query.
Simply with ajax I just make a get request to the route and with the response I see now how I can use ajaxify.
// search function
$('form.search').on('submit', function(e) {
e.preventDefault();
var word = $(this).find('input.searchV').val();
$.ajax({
url: '/api/search/'+word+'?in=titlesposts',
type: 'get',
dataType: 'html',
success: function (data) {
var parsed = JSON.parse(data);
var results = parsed;
console.log(results);
// TODO: pass results.posts into template
ajaxify.loadTemplate('partials/search_results_topic', function(resultItem) {
var html = templates.parse(resultItem, results);
$('.topic-list').html(html);
});
},error: function(data) {
// TODO: error handling
console.log(data);
}
});
});