Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
atqy committed Aug 31, 2022
1 parent d0a50cf commit 35c845d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions _static/kendrasearchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ var KendraSearch = {
init : function() {
var filters = {};
var params = $.getQueryParameters();
console.log(params);
if (params.q) {
var query = params.q[0];
$('input[name="q"]')[0].value = query;
Expand Down Expand Up @@ -588,14 +587,11 @@ var KendraSearch = {
*/
query : function(query, pageNumber, pageSize=10, filters={}) {
var url = "https://9cs56celvj.execute-api.us-west-2.amazonaws.com/prod"
console.log("url: " + url);

$('#search-progress').empty();

query = KendraSearch.sanitize(query);

console.log(query, pageNumber, pageSize, filters, window.location.host);

fetch(url, {
method: 'post',
body: JSON.stringify({ "queryText": query , "pageNumber": pageNumber, "pageSize": pageSize, "filters": filters, "host": window.location.host}),
Expand Down Expand Up @@ -650,7 +646,6 @@ var KendraSearch = {
}else{
KendraSearch.stopPulse();
KendraSearch.title.text(_('Search Results'));

var no_pages = Math.min(Math.floor(parseFloat(data["TotalNumberOfResults"])/parseFloat(pageSize))+1, 100.00/parseFloat(pageSize));
var maxPaginationButtons = Math.min(6, no_pages);
var startPaginationButtons = Math.max(1, pageNumber-Math.ceil(maxPaginationButtons/2));
Expand All @@ -664,6 +659,7 @@ var KendraSearch = {
}
}
KendraSearch.out.append(paginationItem);

$('.paginationnolink').each(function ( index, element ) {
$(element).on('click', function() {
KendraSearch.output.empty();
Expand Down Expand Up @@ -697,15 +693,6 @@ var KendraSearch = {

this.query(query, 1, pageSize=10, filters=filters)
},

submitFilterForm: function(that){
console.log(that);
console.log(that.filterSDKGuide.checked);
this.filters["exampleFilter"] = that.filterExample.checked;
this.filters["awsDevGuideFilter"] = that.filterAWSDevGuide.checked;
this.filters["sdkGuideFilter"] = that.filterSDKGuide.checked;

}

};

Expand Down

0 comments on commit 35c845d

Please sign in to comment.