%PDF- %PDF-
Direktori : /proc/self/root/proc/self/root/etc/ansible/roles/sphinx/templates/ |
Current File : //proc/self/root/proc/self/root/etc/ansible/roles/sphinx/templates/create_index_in_web.php.j2 |
<?php // {{ ansible_managed }} $_SERVER["DOCUMENT_ROOT"] = "{{ item.DocumentRoot }}"; $DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"]; define("NO_KEEP_STATISTIC", true); define("NOT_CHECK_PERMISSIONS",true); define("BX_NO_ACCELERATOR_RESET", true); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); // if $oReIndex == Y than start reindex operation for site $oReIndex = {{ manage_reindex|default('N') }}; if(!CModule::IncludeModule("search")) { echo "Not found serach module for {{ item.SiteName }}"; return 1; } // update options COption::SetOptionString("search", "full_text_engine", "sphinx"); COption::SetOptionString("search", "sphinx_connection", "{{ inventory_hostname }}:{{ sphinx_mysqlproto_listen }}"); COption::SetOptionString("search", "sphinx_index_name", "{{ item.SiteCsync2 }}"); echo "Sphinx search on on site"; if($oReIndex == "Y") { @ini_set("max_execution_time", 0); @set_time_limit(0); $res = CSearch::ReIndexAll(true, 0, false); if(intval($res) > 0) echo "Index created"; } return 0;