What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

I dont see the elastic search document has field template for the cms_search_page. Any suggestions a

UPWG882P6
UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

I dont see the elastic search document has field template for the cms_search_page. Any suggestions are appreciated.

Comments

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    do you mean template name or template ID of CMS Page?

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    in

    LocaleCmsPageDataTransfer
    

    you can find

    templatePath
    

    property, if it’s OK for you just use it in extended on project level
    \Spryker\Zed\CmsPageSearch\Business\Search\DataMapper\CmsPageSearchDataMapper and add this info to the result array.

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    if you need additional info just expand LocaleCmsPageDataTransfer on project, add new properties, fill them and use in CmsPageSearchDataMapper

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    In Spy_cms_page table has fk_template id, which is foriegn key from spy_cms_template table. when i ran de_Search/Search GET query in elastic search i found there is no way that i can fetch the results based on template(i,e fk_template_id or spy_cms_template name column).

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    when i checked the elastic structure it doesnt have this key template.

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    out of the box yes, there is not template info.

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    please check CmsPageSearchDataMapper

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    Do you mean

    CmsDataPageMapBuilder
    

    ?

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    \Spryker\Zed\CmsPageSearch\Business\Search\DataMapper\CmsPageSearchDataMapper and \Spryker\Zed\CmsPageSearch\Communication\Plugin\Search\CmsDataPageMapBuilder i think they are related to each other if you add new data to data mapper, you need to include it in CmsDataPageMapBuilder also

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    I dont see a DataMapper folder

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ah sorry, it’s from latest version of the module.

    in this case yes you are right \Spryker\Zed\CmsPageSearch\Communication\Plugin\Search\CmsDataPageMapBuilder

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    Ok, once I add the fields in CmsPageMapBuilder, then what are the process steps to follow to see change in the result in elastic search?

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    these are the cmds i ran in the vagrant box

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    console search:setup

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    console queue:task:start event

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    just save and publish some of the page in Backoffice (Zed UI)

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    did that too

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    console search:setup you need only if you need to create some specific mappings for the ES document.

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ok

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    console queue:task:start event is working as a cronjob in jenkins, you don’t need to run it manually

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    after changes of CmsDataPageMapBuilder please check spy_cms_page_search table (data and structured_data columns) you should see your new column inside

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    I see new column in structured_data but not in data

  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    what is it missing that i see in one column and not in other?

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe something here \Spryker\Zed\CmsPageSearch\Business\Search\CmsPageSearchWriter ?

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    mapToSearchData()
    
  • UPWG882P6
    UPWG882P6 Posts: 140 πŸ§‘πŸ»β€πŸš€ - Cadet

    Can you give an example how to add new field to this mapTosearchData.