Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -59,7 +59,7 @@ class _search extends \IPS\Dispatcher\Controller
),
'toggles' => array(
'mysql' => array( 'search_index_timeframe' ),
'elastic' => array( 'search_elastic_server', 'search_elastic_index', 'search_elastic_analyzer', 'search_decay', 'search_elastic_self_boost' )
'elastic' => array( 'search_elastic_server', 'search_elastic_index', 'search_elastic_analyzer', 'search_decay', 'search_elastic_self_boost', 'search_index_maxresults' )
)
) ) );
$form->add( new \IPS\Helpers\Form\Url( 'search_elastic_server', \IPS\Settings::i()->search_elastic_server, NULL, array( 'placeholder' => 'http://localhost:9200' ), function( $val )
@@ -142,12 +142,14 @@ class _search extends \IPS\Dispatcher\Controller
), NULL, NULL, NULL, 'search_decay' ) );
$form->add( new \IPS\Helpers\Form\Number( 'search_elastic_self_boost', \IPS\Settings::i()->search_elastic_self_boost, FALSE, array( 'unlimited' => floatval( 0 ), 'unlimitedLang' => 'do_not_boost', 'decimals' => 1 ), NULL, \IPS\Member::loggedIn()->language()->addToStack('search_elastic_self_boost_prefix'), \IPS\Member::loggedIn()->language()->addToStack('search_elastic_self_boost_suffix'), 'search_elastic_self_boost' ) );
$form->add( new \IPS\Helpers\Form\Number( 'search_index_timeframe', \IPS\Settings::i()->search_index_timeframe, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'search_index_timeframe_unlimited' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('search_index_timeframe_prefix'), \IPS\Member::loggedIn()->language()->addToStack('search_index_timeframe_suffix'), 'search_index_timeframe' ) );
$form->add( new \IPS\Helpers\Form\Number( 'search_index_maxresults', \IPS\Settings::i()->search_index_maxresults, FALSE, array(), NULL, NULL, NULL, 'search_index_maxresults' ) );
if ( $values = $form->values() )
{
$engine = \IPS\Settings::i()->search_method;
$indexPrune = \IPS\Settings::i()->search_index_timeframe;
$analyzer = \IPS\Settings::i()->search_elastic_analyzer;
$maxResults = \IPS\Settings::i()->search_index_maxresults;
if ( isset( $values['search_decay'][2] ) )
{
@@ -178,7 +180,7 @@ class _search extends \IPS\Dispatcher\Controller
\IPS\Session::i()->log( 'acplogs__search_settings' );
/* And re-index if setting updated */
if( $engine != $values['search_method'] or ( $values['search_method'] == 'elastic' and $values['search_elastic_analyzer'] != $analyzer ) )
if( $engine != $values['search_method'] or ( $values['search_method'] == 'elastic' and ( $values['search_elastic_analyzer'] != $analyzer or $values['search_index_maxresults'] != $maxResults ) ) )
{
/* We pass TRUE to the i() method to ensure we get a new instance, otherwise the old instance cached from the previous prune call will be used */
\IPS\Content\Search\Index::i( TRUE )->init();