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

Filtering on main_taxon.slug delivers no results #92

Open
wimulkeman opened this issue May 16, 2018 · 0 comments
Open

Filtering on main_taxon.slug delivers no results #92

wimulkeman opened this issue May 16, 2018 · 0 comments

Comments

@wimulkeman
Copy link

wimulkeman commented May 16, 2018

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

@wimulkeman wimulkeman changed the title Searching on main_taxon.slug delivers no results Filtering on main_taxon.slug delivers no results May 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant