mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Introduce an input field for the facet filters on the http-ui
This commit is contained in:
parent
2341b99379
commit
218eb97241
3 changed files with 10 additions and 7 deletions
|
@ -1,8 +1,9 @@
|
|||
var request = null;
|
||||
var timeoutID = null;
|
||||
|
||||
$('#search').on('input', function () {
|
||||
var query = $(this).val();
|
||||
$('#query, #facet').on('input', function () {
|
||||
var query = $('#query').val();
|
||||
var facet = $('#facet').val();
|
||||
var timeoutMs = 100;
|
||||
|
||||
if (timeoutID !== null) {
|
||||
|
@ -14,7 +15,7 @@ $('#search').on('input', function () {
|
|||
type: "POST",
|
||||
url: "query",
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({ 'query': query }),
|
||||
data: JSON.stringify({ 'query': query, 'facetCondition': facet }),
|
||||
contentType: 'application/json',
|
||||
success: function (data, textStatus, request) {
|
||||
results.innerHTML = '';
|
||||
|
@ -77,5 +78,5 @@ $('#db-size').text(function(index, text) {
|
|||
// We trigger the input when we load the script, this way
|
||||
// we execute a placeholder search when the input is empty.
|
||||
$(window).on('load', function () {
|
||||
$('#search').trigger('input');
|
||||
$('#query').trigger('input');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue