var search_tit,search_page=0
var data1
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) { return pair[1]; }
}
return (false);
}
if(getQueryVariable('keywords')){//第一次打开页面判断keywords是否有值
search_click(0,getQueryVariable('keywords'))
}
var yema=true,fanye=false
$('.f_button').on('click',function(){//搜索按钮触发
var inpCont = $('input[name=input_ss]').val();
//inpCont=encodeURI(inpCont)
if (inpCont.replace(/(^\s*)|(\s*$)/g, "") != "") {
search_click(search_page,inpCont)
$('.invalid-feedback').hide()
}else{
$('.invalid-feedback').show()
}
yema=true,fanye=false
console.log('搜索按钮触发')
})
function search_click(search_page,search_tit){
console.log(search_page+','+search_tit)
var data1 = {
"from": search_page*10,
"size": 10,
"sort":{
"DETAIL_ES.es_date_prePublishTime":"desc"
},
"query": {
"function_score": {
"min_score": 0.000001,
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20677"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_zshtc": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.tsaob": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20679"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_zshtc": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.tsaob": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20681"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_zshtc": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.tsaob": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20689"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_rudao": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.zdlcm": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20690"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_uzjhi": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.zdlcm": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20692"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_uzjhi": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.zdlcm": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135174"
}
},
{
"term": {
"TID": "20693"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_rudao": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.zdlcm": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135491"
}
},
{
"term": {
"TID": "20859"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_uzjhi": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.tsaob": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135491"
}
},
{
"term": {
"TID": "20860"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_uzjhi": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.tsaob": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135491"
}
},
{
"term": {
"TID": "22475"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "135491"
}
},
{
"term": {
"TID": "23648"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"DETAIL_ES.es_symbol_tsaob": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.yjpqi": search_tit
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"_index": "cms_site_low_code"
}
},
{
"term": {
"TENANT_ID": 282178
}
},
{
"term": {
"appId": "141309"
}
},
{
"term": {
"TID": "23075"
}
}
],
"should": [
{
"match_phrase": {
"DETAIL_ES.es_symbol_entityTitle": search_tit
}
},
{
"match_phrase": {
"TEXT_DETAIL_ES.es_text_des": search_tit
}
},
{
"match_phrase": {
"CONTENT.zdlcm": search_tit
}
}
]
}
}
]
}
}
}
}
}
$.ajax({
url: "/nportal/fwebapi/cms/lowcode/totalStationSearch",
type: "POST",
data: JSON.stringify(data1),
cache: false,
dataType: "json",
contentType: "application/json;charset=utf8",
success: function (data) {
var TotalData=data.data.result.list
console.log(data.data.result)
var DataHtml=''
$('.s_length .p_resNum').html(data.data.result.page.totalCount)
$('.s_length').show()
if(yema){
yema=false
function getOptionsFromForm(){
var opt = {
callback: pageselectCallback,
items_per_page:1,//每页显示的个数
num_display_entries:3,//...前面显示出来的页数
num_edge_entries:1, //最后留的页数
prev_text:'<',
next_text:'>',
link_to:'javascript:;',
load_first_page : true
};
return opt;
}
var num_entries = Math.ceil(data.data.result.page.totalCount / 10);
optInit = getOptionsFromForm();
$(".pagination_box").pagination(num_entries, optInit)
function pageselectCallback(page_index, jq) {
if(fanye){
search_click(page_index,search_tit)
}
fanye=true
}
}
for(var i=0;i