[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][ENH] Ability to change index max result window for ElasticSearch

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6913b7108dbf_2ce2f2c36667@gitlab-sidekiq-low-urgency-cpu-bound-v2-75c9b85b48-lpqd6.mail>

Adrien Mbuya Maloba pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
b4e68c2a by Adrien Mbuya Maloba at 2025-11-12T00:15:53+02:00
[BP][ENH] Ability to change index max result window for ElasticSearch
---
* [ENH] Ability to change index max result window for ElasticSearch
---
* [ENH] Ability to change index max result window for ElasticSearch

See merge request tikiwiki/tiki!8982

See merge request tikiwiki/tiki!9006

- - - - -


3 changed files:

- lib/core/Search/Elastic/Index.php
- lib/prefs/unified.php
- templates/admin/include_search.tpl


Changes:

=====================================
lib/core/Search/Elastic/Index.php
=====================================
@@ -264,6 +264,12 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
             ],
         ];
 
+        if (! empty($prefs['unified_elastic_index_max_result_window'])) {
+            $definition['index'] = [
+                'max_result_window' => (int) $prefs['unified_elastic_index_max_result_window'],
+            ];
+        }
+
         // optionally removes 's from the end of words
         if ($this->possessiveStemmer) {
             $definition['analysis']['analyzer']['default']['filter'][] = 'english_possessive_stemmer';


=====================================
lib/prefs/unified.php
=====================================
@@ -274,6 +274,14 @@ function prefs_unified_list()
             'description' => tra('In case of Elasticsearch is active and unavailable, use MySQL Full-Text Search as fallback'),
             'default' => 'n',
         ],
+        'unified_elastic_index_max_result_window' => [
+            'name' => tra('Index max result window for ElasticSearch'),
+            'description' => tra('This allows a larger amount of data to be recorded.'),
+            'type' => 'text',
+            'size' => '3',
+            'units' => tra('records'),
+            'default' => '',
+        ],
         'unified_mysql_index_current' => [
             'name' => tra('MySQL full-text search current index'),
             'description' => tra('A new index is created upon rebuilding, and the old one is then destroyed. This setting enables seeing the currently active index.'),


=====================================
templates/admin/include_search.tpl
=====================================
@@ -88,6 +88,7 @@
                             {tr}Elasticsearch is a tiki external service. You should set at least a daily full index rebuild to keep the MySQL index updated in case of Elastic unavailability{/tr}.
                         {/remarksbox}
                         {preference name="unified_elastic_mysql_search_fallback"}
+                        {preference name="unified_elastic_index_max_result_window"}
                     </div>
 
                     <div class="adminoptionboxchild unified_engine_childcontainer mysql">



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b4e68c2a130caa06081e6f48c3cfd591ed298d1a

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b4e68c2a130caa06081e6f48c3cfd591ed298d1a
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.