Volltextsuche via blevesearch hinzugefügt
This commit is contained in:
@ -120,6 +120,11 @@
|
||||
<li id="btnSavepage"><a href="#" onclick="SavePage()">Save</a></li>
|
||||
<li id="btnPDFgen"><a href="#" onclick="PDFGen()">PDF</a></li>
|
||||
</ul>
|
||||
<form class="navbar-form nav navbar-nav navbar-right" role="search">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</nav>
|
||||
@ -224,7 +229,34 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#srch-term').keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
//alert($('#srch-term').val());
|
||||
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
contentType:'application/json; charset=utf-8',
|
||||
url: '/_api/fts/'+$('#srch-term').val(),
|
||||
dataType: "json",
|
||||
data: "",
|
||||
success: function(content){
|
||||
|
||||
html = "<h2> Suche</h2>Der Suchbegriff <b>\""+$('#srch-term').val()+"\"</b> wurde <b>"+content.length +"</b> mal in folgenden Seiten gefunden:<hr>"
|
||||
//html = MD2HTMLConverter.makeHtml(content+$("#outputsidebar").html());
|
||||
//console.log(content);
|
||||
$("#outputdiv").html(html);
|
||||
$("#outputdiv").show();
|
||||
|
||||
content.forEach(function (item, index) {
|
||||
console.log(item.id);
|
||||
var page = item.id.replace(/.md/, '');
|
||||
$("#outputdiv").append("<a href='/"+page+"'>/"+page+"</a><br>");
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function EditPage() {
|
||||
|
Reference in New Issue
Block a user