Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter query type based on FilterDefinition objects - Work in Progess #149

Open
wants to merge 69 commits into
base: 1.x
Choose a base branch
from

Conversation

das-peter
Copy link

It would be great to be able to use the GraphQL integration with the IndexService from the EcommerceFrameworkBundle.
Currently this pull requests works with following GraphQL Syntax:

{
  getProductFilter(
    fulltext: "Wellness", 
    first: 5, 
    filterDefinition: 133836, 
    facets: [{field: "parentCategoryIds", values: ["72448"]}]
  ) {
    edges {
      node {
        id
        articleNo
        title
        description
      }
    }
    facets{
    	facet {
        field
        label
        options {
          value
          label
          count
        }
      }
    }
    totalCount
  }
}

The query returns the matching nodes as well as the factes defined in the filterDefinition 133836.
Return format of the facets:

      "facets": [
        {
          "facet": {
            "field": "parentCategoryIds",
            "label": "Kategorie",
            "options": [
              {
                "value": "71990",
                "label": "parentCategoryIds:71990",
                "count": 119
              },
              {
                "value": "71991",
                "label": "parentCategoryIds:71991",
                "count": 53
              }
            ]
          }
        }

Tasks I'm currently aware of:

  • Fulltext-Search
    • DB
    • Elastic
  • Paging
    • DB
    • Elastic
  • Support conditions from service configuration
    • DB
    • Elastic
  • Support workspace permission checks
    • DB
    • Elastic
  • Fix for facet values handling. Currently the FilterService API differentiates strictly between multi / single value filter. However there's no API to properly determine what a FilterType actually supports. So right now we have to make some sort of educated guess in: HijackAbstractFilterType::isMultiValueFilter(). Would need refactoring in EcommerceFrameworkBundle
    • Allow facet values to be single or multivalue. This could be a workaround for the parent task. If the query has to properly define if a single / multivalue has to be used we could scratch the educated guess. However currently only the multivalue syntax is allowed for the facet value:
      {field: "parentCategoryIds", values: ["72448"]} instead
      {field: "parentCategoryIds", values: "72448"}
      Attempts to use the UnionType to allow multiple types as input failed so far.
  • Refactor EcommerceFrameworkBundle to allow accessing the field name from AbstractFilterType. Currently we use scope hijacking in HijackAbstractFilterType::getFieldFromFilter() to call the necessary but protected methods.

@fashxp
Copy link
Member

fashxp commented Dec 12, 2019

see also pimcore/pimcore#3537
I like the idea, need to have a detailed look at it though,

@fashxp fashxp mentioned this pull request Jan 23, 2020
@weisswurstkanone weisswurstkanone moved this from In progress to Done in v0.5 ("Hydrophobia") Feb 7, 2020
@weisswurstkanone weisswurstkanone moved this from Done to In progress in v0.5 ("Hydrophobia") Feb 7, 2020
@weisswurstkanone weisswurstkanone added this to In progress in v0.6 ("Prefix") Feb 7, 2020
@julkue
Copy link
Contributor

julkue commented Feb 19, 2020

Any update here?

@weisswurstkanone weisswurstkanone removed this from In progress in v0.6 ("Prefix") Apr 1, 2020
@CLAassistant
Copy link

CLAassistant commented Apr 24, 2020

CLA assistant check
All committers have signed the CLA.

@weisswurstkanone
Copy link
Contributor

@fashxp ping
@julmot could you resolve the conflict please ?

juckerf and others added 19 commits November 2, 2020 09:32
added support for object arrays instead of string arrays only
changed structure for request filters directly without "facet" hierarchy
to get different filter types separately
added filterType for each supported filter
…terTypes" needed to create dynamically Filter Object based on configurated filter types in ecommerce-config.yml

changed QueryType.php to create dynamically Filter Object Types based on configuration
…er description in the generated documentation

skip filter fields in Resolver\QueryType.php which are not in the GraphQL Request to prevent empty arrays in the response
…slated while stored in elastic and the relation object are translated separate with an event
…' into filter-query-type

# Conflicts:
#	src/GraphQL/Query/QueryType.php
#	src/GraphQL/Resolver/AssetType.php
#	src/GraphQL/Resolver/QueryType.php
@weisswurstkanone weisswurstkanone added this to In progress in v1.0 (Dogmatix) via automation Apr 28, 2021
@weisswurstkanone weisswurstkanone added this to the v0.9 (Dogmatix) milestone Apr 28, 2021
@weisswurstkanone weisswurstkanone removed this from In progress in v1.0 (Dogmatix) May 10, 2021
@fashxp fashxp removed this from the v1.1.0 (Instantmix) milestone Oct 27, 2021
@brusch brusch removed the Proposal label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v0.5 ("Hydrophobia")
  
In progress
v0.8 ("Tenansix")
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

10 participants