OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

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

This topic contains 4 replies, has 3 voices, and was last updated by  nevoeiro 6 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #32744

    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
  • #32745

    Ilya Antypenko
    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.

    #32746

    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

    #32747

    vitaliyberdylo
    Participant

    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

    #32748

    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)

The forum ‘OroCommerce’ is closed to new topics and replies.

Back to top