Skip to content
This repository was archived by the owner on Aug 3, 2018. It is now read-only.
This repository was archived by the owner on Aug 3, 2018. It is now read-only.

Filtering on main_taxon.slug delivers no results #92

@wimulkeman

Description

@wimulkeman

After updating to sylius/elastic-search-plugin:v1.0.0-beta.17, I wasn't able to search for data put into objects within ElasticSearch, and in fields containing a dot in their name (main_taxon.slug).

The following code would not work afterwards:

/** @var FilterManagerInterface $filterManager */
$filterManager = $this->get('ongr_filter_manager.manager.search_list');

/** @var LocaleContextInterface $channelLocale */
$channelLocale = $this->get('sylius.context.locale');
$localeCode = $channelLocale->getLocaleCode();

/** @var ChannelContextInterface $channelContext */
$channelContext = $this->get('sylius.context.channel');
$channel = $channelContext->getChannel();

$request->query->set('taxonSlug', $request->attributes->get('slug'));
$request->query->set('channel', [$channel->getCode()]);
$request->query->set('locale', $localeCode);

$response = $filterManager->handleRequest($request);

The field taxonSlug has the following config for it in ONGR:

taxonSlug:
    type: multi_choice
    request_field: taxonSlug
    document_field: taxons.slug

Downgrading to sylius/elastic-search-plugin:v1.0.0-beta.16 fixed it for me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions