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
 define('SPHINXQL_PORT',      9306);
48
 define('SPHINXQL_PORT',      9306);
49
 define('SPHINXQL_SOCK',      false);
49
 define('SPHINXQL_SOCK',      false);
50
 define('SPHINX_MAX_MATCHES', 1000); // Must be <= the server's max_matches variable (default 1000)
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
 define('SPHINX_INDEX',       'torrents');
52
 define('SPHINX_INDEX',       'torrents');
52
 
53
 
53
 // Ocelot details
54
 // Ocelot details

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

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

Loading…
Cancel
Save