diff --git a/README.md b/README.md index 46e8562d..3cd69cb0 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,6 @@ as separate packages. Building your own condition processor is also possible. * [Doctrine2 DBAL](https://github.com/rollerworks/search-doctrine-dbal) * [Doctrine2 ORM](https://github.com/rollerworks/search-doctrine-orm) -* Apache Solr (coming soon) * [Elasticsearch](https://github.com/rollerworks/search-elasticsearch) (coming soon) Requirements diff --git a/doc/input/filter_query.rst b/doc/input/filter_query.rst index 7653dac1..572f81b9 100644 --- a/doc/input/filter_query.rst +++ b/doc/input/filter_query.rst @@ -235,25 +235,25 @@ to mark the group as logical AND. .. code-block:: php - &(field1=values; field2=values); + &(field1: values; field2: values); To change a group and make it OR'ed (at least one field must give a positive match), prefix the group with an ``*`` character. .. code-block:: php - *(field1=values; field2=values); + *(field1: values; field2: values); If you want to head-group (the condition itself) OR'ed or AND (default) use ``*`` or ``&`` as the first character in the condition. .. code-block:: php - *field1=values; field2=values; + *field1: values; field2: values; .. code-block:: php - &field1=values; field2=values; + &field1: values; field2: values; .. caution:: diff --git a/src/ValuesBag.php b/src/ValuesBag.php index 64c82661..4945f562 100644 --- a/src/ValuesBag.php +++ b/src/ValuesBag.php @@ -131,7 +131,7 @@ public function addExcludedValue(SingleValue $value) throw new ValuesStructureIsLocked(); } - $this->simpleExcludedValues[] = $value; + $this->simpleExcludedValues[] = $value->getValue(); $this->simpleExcludedValuesObjects[] = $value; ++$this->valuesCount; diff --git a/tests/ValuesBagTest.php b/tests/ValuesBagTest.php index 4c24b928..116ec438 100644 --- a/tests/ValuesBagTest.php +++ b/tests/ValuesBagTest.php @@ -28,7 +28,7 @@ public function it_allows_adding_simple_values() { $valuesBag = new ValuesBag(); $valuesBag->addSimpleValue('value'); - $valuesBag->addSimpleValue('value2'); + $valuesBag->addSingleValue(new SingleValue('value2')); $this->assertTrue($valuesBag->hasSimpleValues()); $this->assertEquals(['value', 'value2'], $valuesBag->getSimpleValues()); @@ -36,6 +36,7 @@ public function it_allows_adding_simple_values() // To be removed in 2.0 $this->assertTrue($valuesBag->hasSingleValues()); $this->assertEquals([new SingleValue('value'), new SingleValue('value2')], $valuesBag->getSingleValues()); + $this->assertEquals(['value', 'value2'], $valuesBag->getSimpleValues()); } /** @@ -105,7 +106,7 @@ public function it_allows_adding_excluded_simple_values() { $valuesBag = new ValuesBag(); $valuesBag->addExcludedSimpleValue('value'); - $valuesBag->addExcludedSimpleValue('value2'); + $valuesBag->addExcludedValue(new SingleValue('value2')); $this->assertTrue($valuesBag->hasExcludedSimpleValues()); $this->assertEquals(['value', 'value2'], $valuesBag->getExcludedSimpleValues());