Browse Source

Move sphinx max_matches stuff into config

spaghetti 8 years ago
parent
commit
5d802cd9b3
2 changed files with 2 additions and 1 deletions
  1. 1
    0
      classes/config.template
  2. 1
    1
      classes/torrentsearch.class.php

+ 1
- 0
classes/config.template View File

@@ -48,6 +48,7 @@ define('SPHINXQL_HOST',      '127.0.0.1');
48 48
 define('SPHINXQL_PORT',      9306);
49 49
 define('SPHINXQL_SOCK',      false);
50 50
 define('SPHINX_MAX_MATCHES', 1000); // Must be <= the server's max_matches variable (default 1000)
51
+define('SPHINX_MIN_MAX_MATCHES', 2000); // Exclusively for fixing total number of default search results. Raise as necessary
51 52
 define('SPHINX_INDEX',       'torrents');
52 53
 
53 54
 // Ocelot details

+ 1
- 1
classes/torrentsearch.class.php View File

@@ -182,7 +182,7 @@ class TorrentSearch {
182 182
         ->order_by(self::$SortOrders[$OrderBy], $OrderWay);
183 183
     }
184 184
     $Offset = ($this->Page - 1) * $ResultLimit;
185
-    $MaxMatches = max($Offset + $ResultLimit, 1500);
185
+    $MaxMatches = max($Offset + $ResultLimit, SPHINX_MIN_MAX_MATCHES);
186 186
     $this->SphQL->from('torrents, delta')
187 187
       ->limit($Offset, $ResultLimit, $MaxMatches);
188 188
   }

Loading…
Cancel
Save