Author: rande
Date: 2010-01-18 19:09:10 +0100 (Mon, 18 Jan 2010)
New Revision: 26831
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/util/sfLuceneCriteria.class.php
Log:
[sfSolrPlugin] fix sfLuceneCriteria due to last commit
Modified:
plugins/sfSolrPlugin/branches/sf1.2/lib/util/sfLuceneCriteria.class.php
===================================================================
--- plugins/sfSolrPlugin/branches/sf1.2/lib/util/sfLuceneCriteria.class.php
2010-01-18 18:08:01 UTC (rev 26830)
+++ plugins/sfSolrPlugin/branches/sf1.2/lib/util/sfLuceneCriteria.class.php
2010-01-18 18:09:10 UTC (rev 26831)
@@ -140,7 +140,7 @@
if(strlen($query) == 0)
{
- return $this;
+ return false;
}
$query = '('.$query.')';
@@ -168,19 +168,22 @@
public function add($query, $type = sfLuceneCriteria::TYPE_AND, $force =
false)
{
- $query = $this->checkQueryFragment($query, $force);
+ if($query = $this->checkQueryFragment($query, $force))
+ {
+ $this->query = strlen($this->query) == 0 ? $query : $this->query.'
'.$type.' '.$query;
+ }
- $this->query = strlen($this->query) == 0 ? $query : $this->query.'
'.$type.' '.$query;
-
return $this;
}
public function addField($field, $query, $type = sfLuceneCriteria::TYPE_AND,
$force = false)
{
- $query = $field.':('.$this->checkQueryFragment($query, $force).')';
-
- $this->query = strlen($this->query) == 0 ? $query : $this->query.'
'.$type.' '.$query;
-
+ if($query = $this->checkQueryFragment($query, $force))
+ {
+ $query = $field.':('.$query.')';
+ $this->query = strlen($this->query) == 0 ? $query : $this->query.'
'.$type.' '.$query;
+ }
+
return $this;
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.