summaryrefslogtreecommitdiff
path: root/app/models/EntriesGetter.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-09-03 23:35:33 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-09-03 23:35:33 +0200
commitf55ae730e6477f37566722961ca7e7ab9ad7f3c5 (patch)
tree58067c75dca070e2785ba8ba7f0f694f3ad9881a /app/models/EntriesGetter.php
parentf855dbdca6e95ac367b7a9dae9d3a866e1f85d37 (diff)
Disable SQL LIMIT optimisation during search
This patch is to make search work again after the new SQL optimisations, by removing some of the optimisations when searching is used. Optimisation of search is left for some future work. The whole base is indeed transfered from MySQL to PHP, which is not good.
Diffstat (limited to 'app/models/EntriesGetter.php')
-rw-r--r--app/models/EntriesGetter.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/EntriesGetter.php b/app/models/EntriesGetter.php
index dc7ecca7c..803aad732 100644
--- a/app/models/EntriesGetter.php
+++ b/app/models/EntriesGetter.php
@@ -98,13 +98,15 @@ class EntriesGetter {
HelperEntry::$first = $this->first; //TODO: Update: Now done in SQL
HelperEntry::$filter = $this->filter;
+ $sqlLimit = (empty ($this->filter['words']) && empty ($this->filter['tags'])) ? $this->nb : ''; //Disable SQL LIMIT optimisation during search //TODO: Do better!
+
switch ($this->type['type']) {
case 'all':
list ($this->entries, $this->next) = $entryDAO->listEntries (
$this->state,
$this->order,
$this->first,
- $this->nb
+ $sqlLimit
);
break;
case 'favoris':
@@ -112,7 +114,7 @@ class EntriesGetter {
$this->state,
$this->order,
$this->first,
- $this->nb
+ $sqlLimit
);
break;
case 'public':
@@ -120,7 +122,7 @@ class EntriesGetter {
$this->state,
$this->order,
$this->first,
- $this->nb
+ $sqlLimit
);
break;
case 'c':
@@ -129,7 +131,7 @@ class EntriesGetter {
$this->state,
$this->order,
$this->first,
- $this->nb
+ $sqlLimit
);
break;
case 'f':
@@ -138,7 +140,7 @@ class EntriesGetter {
$this->state,
$this->order,
$this->first,
- $this->nb
+ $sqlLimit
);
break;
default: