diff --git a/oth/techUtils.txt b/oth/techUtils.txt new file mode 100644 index 0000000..a3f6c83 --- /dev/null +++ b/oth/techUtils.txt @@ -0,0 +1 @@ +db.notizia.ensureIndex({"about.author": "text",sottotitolo: "text",testo: "text",titolo: "text"},{weights: {"about.author": 1,sottotitolo: 7,testo: 5,titolo: 10},name: "notiziaDetails"}) \ No newline at end of file diff --git a/private/lib/gui/DatatablesHelper.php b/private/lib/gui/DatatablesHelper.php index be1af8a..d05517d 100644 --- a/private/lib/gui/DatatablesHelper.php +++ b/private/lib/gui/DatatablesHelper.php @@ -30,6 +30,7 @@ class DatatablesHelper { $models = array(); if (array_key_exists("search", $_POST) && array_key_exists("value", $_POST["search"]) && strcmp(trim($_POST["search"]["value"]),"")!=0 ){ + unset($options["sort"]); $models = $dao->search($useModel, trim($_POST["search"]["value"]), $filter, $options); $ret->recordsTotal = $dao->searchCount($useModel, trim($_POST["search"]["value"])); diff --git a/public/mobile/searchResults.php b/public/mobile/searchResults.php index 7f3fdd5..53d4072 100644 --- a/public/mobile/searchResults.php +++ b/public/mobile/searchResults.php @@ -52,7 +52,7 @@ try { $notizie = GlobalVariables::get("dao")->search("NotiziaModel",$searchParameters, array("status"=>NotiziaModel::STATUS_ACCEPTED), - array("sort"=>array("about.data"=>-1),"limit"=>$limit,"skip"=>$skip) + array("limit"=>$limit,"skip"=>$skip) ); // $notizie = GlobalVariables::get("dao")->query("NotiziaModel",