Skip to content

Tags: PHP-CMSIG/search

Tags

0.12.10

Toggle 0.12.10's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update dependencies and fix linting of Symfony after Rector update (#680

)

Just `composer update` and update the rector.php of Symfony example.

0.12.9

Toggle 0.12.9's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix phpstan issue with returned array highlight in Solr and Memory In…

… and NotIn Conditions (#660)

Fixes following PHPStan issue by ignore them as we expected the fields
are created in the expected document schema:

```
 ------ ------------------------------------------------------------------------------------------
  Line   src/SolrSearcher.php
 ------ ------------------------------------------------------------------------------------------
  203    Parameter #2 $array of function implode expects array<string>, array<mixed, mixed> given
         .
         🪪  argument.type
 ------ ------------------------------------------------------------------------------------------
```

```
 ------ -----------------------------------------------------------------------------------------
  Line   src/MemorySearcher.php
 ------ -----------------------------------------------------------------------------------------
  198    Parameter #2 $arrays of function array_intersect expects an array of values castable to
         string, array<mixed, mixed> given.
         🪪  argument.type
  208    Parameter #2 $arrays of function array_intersect expects an array of values castable to
         string, array<mixed, mixed> given.
         🪪  argument.type
 ------ -----------------------------------------------------------------------------------------
```

0.12.8

Toggle 0.12.8's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add refresh flag when return_slow_promise_result is enabled. (#648)

Fixes #645

0.12.7

Toggle 0.12.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update code style changes after PHP CS Fixer update (#640)

Some new changes from PHP CS Fixer are applied here like `static` to
anonymous functions.

0.12.6

Toggle 0.12.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Allow Loupe v0.13 (#624)

Loupe 0.13 was released: https://github.com/loupe-php/loupe/releases/tag/0.13.0

0.12.5

Toggle 0.12.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add virtual packages for seal adapters (#620)

All seal adapters will provide `cmsig/seal-adapter-implementation`.

All seal adapters in core go with:

```json
    "provide": {
        "cmsig/seal-adapter-implementation": "self.version"
    },
```

Custom adapters need provide the related / supported `cmsig/seal`
version:


```json
    "provide": {
        "cmsig/seal-adapter-implementation": "0.12.0"
    },
```

As I personally not a big fan of the virtual packages we will currently
not require them in our `integration` packages. But third party are this
way free to require it to make composer fail if no adapter was required
by the project / library.

This should help eventuall a future `contao/backend-search-bundle`
package to require `"cmsig/seal-adapter-implementation": "^0.12"` if
they want that behaviour.

0.12.4

Toggle 0.12.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add support for JsonObjectField (#616)

This adds a new field type which is just here to store metadata in a
json object (`array<string, mixed>`). This kind of data is not search,
facet or filterable.

Usage:

```php
new Index('test', [
    'uuid' => new Field\IdentifierField('uuid'),
    'title' => new Field\TextField('title', sortable: true),
    'metadata' => new Field\JsonObjectField('metadata'),
]);
```

```php
$engine->saveDocument([
    'uuid' => $uuid,
    'title' => $title,
    'metadata' => [
        'routeAttributes' => [
            'site' => 'example',
        ],
    ],
]);
```

See #614

This feature is experimental and may change in future releases.

0.12.3

Toggle 0.12.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Remove none found identifiers in reindex (#603)

To make removal easier the reindex will automatically remove document
which where not provided by requested by the ReindexConfig. This make
specially handling inside ORMs or Listeners on Add, Update, Remove a lot
easier. As they just need to feel up identifiers. Thx goes to @Toflar
who provided suggestion in #472.

fixes #472

### ToDo

 - [x] Add test case
 - [x] Reindex is async and requires in some cases return a task

0.12.2

Toggle 0.12.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add documentation for the factory methods to Condition and Facet clas…

…ses (#602)

If people don't read the documentation they are may not aware of the
`Condition::` or `Facet::` methods. So it should be documented also in
the code via PHPDocs.

0.12.1

Toggle 0.12.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add Static Factory methods for Conditions and Facets (#600)

Current state is that for a good `DX` developers need to import
`CmsIg\Seal\Search\Condition` and use `new Condition\...`. This looks
like this:

```php
use CmsIg\Seal\Search\Condition;

$result = $this->engine->createSearchBuilder('blog')
    ->addFilter(new Condition\AndCondition(
        new Condition\EqualCondition('tags', 'Tech'),
        new Condition\OrCondition(
            new Condition\EqualCondition('tags', 'UX'),
            new Condition\EqualCondition('isSpecial', true),
        ),
    ))
    ->getResult();
```

But some Code Styles prevent that and so they require to import every
conditions by themselves. In that case the Developer Experience is bad
as autocomplete don't work.

For core based filters we could maybe create a additional `Condition`
class which is a helper to quickly create the conditions without the
need for `new SomeCondition`, this could look like this:

```php
use CmsIg\Seal\Search\Condition\Condition;

$result = $this->engine->createSearchBuilder('blog')
    ->addFilter(Condition::and(
        Condition::equal('tags', 'Tech'),
        Condition::or(
            Condition::equal('tags', 'UX'),
            Condition::equal('isSpecial', true),
        ),
    ))
    ->getResult();
```

The query builder would so still be PHP and static code analyzer like
phpstan can validate most params, but without the force of every
conditions being imported by itself.

## Todo

- [x] Add Condition class
- [x] Add Facet class
- [x] Update Tests
- [x] Update Documentation

---

fixes #481