Forums

Covering OroCommerce topics, B2B eCommerce trends, community updates and company announcements.

Forums OroCommerce Missing option "type" for "color" field

This topic contains 4 replies, has 3 voices, and was last updated by  nevoeiro 4 months, 3 weeks ago.

  • Creator
    Topic
  • #17872

    nevoeiro
    Participant

    Hi,

    I’m adding a custom Product attribute to Product entity (table ‘oro_product’), and when I run the command ‘console oro:platform:update –force’ I get this error on “running full reindexation of website index” step:

    The way I’m adding my attribute is like:

    And

    What option type is missing and how to set that option? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #17907
    iantypenko
    iantypenko
    Participant

    Hi nevoeiro,
    Which version are you using?

    It happens because you marked your field as “searchable”=>true.

    New field should be added automatically to the search index since 2.5.

    Could you please run

    for your environment. And run migration load command again.

    As a workaround try to add website search configuration for it.
    Something like this:
    https://github.com/oroinc/orocommerce/blob/632f0c19a2db01f7940c2e17621bf90534ff673a/src/Oro/Bundle/ProductBundle/Resources/config/oro/website_search.yml

    E.g.

    #17916

    nevoeiro
    Participant

    Hi iantypenko,

    I’m using platform 2.6 and commerce 1.6

    What you mean with “New field should be added automatically to the search index”?
    Don’t we need to add “searchable”=>true?
    If I don’t add that, then the field isn’t searchable.

    Regarding your suggestion if I clear cache and run the migration:load I don’t get the error. But I don’t want to run that, I mean I don’t want to have a error.

    For the workaround I got this:

    I changed ‘type:string’ by ‘type:text’ and it worked.

    Is this the best approach to add a new searchable attribute? What is the best practice to add a searchable attribute programmatically without having that issue on migration load?
    thanks

    #17942

    vitaliyberdylo
    Moderator

    Hello, nevoeiro
    I recheck you code on commerce 1.6.
    Reindexing was successful without errors.
    It looks like there really were some issues with your cache.
    Adding field to website search configuration manually is not necessary.

    But consider for reindexation working your attribute should be in attribute family.
    https://github.com/oroinc/orocommerce/blob/1.6/src/Oro/Bundle/ProductBundle/EventListener/WebsiteSearchProductIndexerListener.php#L180-L182

    #17974

    nevoeiro
    Participant

    I couldn’t get it working on my side without your workaround. Attribute was added to default family on my migrations too.
    If I back to this topic again I’ll post my finds.
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No
ssossossosso