Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Simonas Šerlinskas
    @saimaz
    Hi
    Jan
    @funkdoobiest
    I want to get die „id“ of a product variant
    but it’s always empty
        /**
         * @var string
         *
         * @ES\Id()
         */
        public $id;
    it’s the same like on product and there it’s working
    any idea?
    Simonas Šerlinskas
    @saimaz
    Hi Jan
    what do you mean by saying variant?
    Jan
    @funkdoobiest
    I’ve checked on elasticsearch and „_id“ for variant is set
    Simonas Šerlinskas
    @saimaz
    is it an object or what?
    the variant?
    Jan
    @funkdoobiest
    yes @ES/Nested
    and on endpoint: variants: true
    Simonas Šerlinskas
    @saimaz
    @ES\Id() annotation works only with Documents
    objects\nested are a structure inside document, it cannot have any id
    Jan
    @funkdoobiest
    I’ve tried with „property"
    Simonas Šerlinskas
    @saimaz
    actually when it’s returned from elasticsearch it is an associated array
    Jan
    @funkdoobiest
    in the document I have this:
       /**
         * @var string
         *
         * @ES\Property(type="string")
         */
        public $_id;
    and
        /**
         * @var
         *
         * @ES\Property(type="string")
         */
        public $sku;
    sku is working
    id not
    Simonas Šerlinskas
    @saimaz
    did you set something to $_id for variant?
    Jan
    @funkdoobiest
    on ES it’s set:
    "variants": [
    {
    "_id": "1844",
    "entity_type_id": "4",
    "attribute_set_id": "10",
    "type_id": "simple",
    "attribute_set": "Edelmetalle",
    "sku": "7225",
    "created_at": "2013-02-21T15:36:52+01:00",
    "updated_at": "2014-01-09 09:25:19",
    "status": "1",
    "title": "Krügerrand",
    "description": "",
    "url": "/krugerrand-31-1g-1",
    "is_salable": true,
    "feingewicht": "31,1g (1 oz)",
    "feinheit": "916,6 / 1000",
    "weight": "1.0000",
    "mindestbestellwert": 1,
    "waehrung": null,
    "waehrungskuerzel": null,
    "category": [
    "4"
    ,
    "5"
    ,
    "9“
    ] …
    hm wait
    I will recreate index, just to be sure.
    Simonas Šerlinskas
    @saimaz
    can you try with different name than _id?
    and for the variant it should be used property
    not id annotation
    Jan
    @funkdoobiest
    i will try
    renamed it to „product_id“ and it’s working, thanks :)
    Simonas Šerlinskas
    @saimaz
    thats good to hear I could help
    but actually it has to work with id
    could you please create an issue about it and paste the elasticsearch structure
    Jan
    @funkdoobiest
    sure
    Simonas Šerlinskas
    @saimaz
    I will take a look later why _id or id isn’t working
    Jan
    @funkdoobiest
    sorry, did not have time to dig deeper in this problem
    but have an other question. how to map an array in elasticsearch document? is there an @ES\Property for this?
    it’s just an array of image urls
    so no need for a nested object
    Mantas Marcinkevičius
    @einorler
    You can just provide a property type string, it can hold a single or an array of strings
    Jan
    @funkdoobiest
    i see, thanks
    Mantas Marcinkevičius
    @einorler
    No problem
    Jan
    @funkdoobiest
    Hey
    I want to generate a url in twig template for a product variant
    but I am getting: Route 'The route object is fit for parsing to generate() method' not found")
    I’ve used „SeoAwareTrait"
    for the variant class