OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions Override search.yml – Search with more parameters

This topic contains 6 replies, has 2 voices, and was last updated by  oro_newbie 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
  • #29019

    oro_newbie
    Participant

    To explain best what I would like to do, it’s actually the same thing that Contact Bundle here is doing but for Account Bundle.

    So, whenever we have an autocomplete dropdown of contact bundle (example, when you are creating a case), you can select contact by searching with different properties like namesuffix, lastname, skype etc. I would like to do the same thing for Account bundle. I got the other properties displaying by putting them in services.yml like:

    And then in my search.yml I have this:

    But in my account autocomplete dropdown, I cannot search for an account using their email or phone although they appear in the list. Is my search.yml not being recognized? Do I need to load it somewhere explicitly rather than just overriding?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #29020

    oro_newbie
    Participant

    Bump. I hope somebody’s read this and can help.

    #29021

    Mike Kudelya
    Participant

    Hi,

    By default, an account doesn’t contain email and phone fields, but if you created them in your custom entity, just run this command to reindex search.

    #29022

    oro_newbie
    Participant

    Thank you Mike.

    I ran that command and added extra parameter OroCRMAccountBundle:Account and I see that the table ‘oro_search_item’ is getting updated with all my account records. Right now it’s creating individual record for names but later I think it will create for email and phone. Is that what’s supposed to happen? My allowed memory size has currently exhausted while running the command. Do I need to give a timeout option? (–timeout=0 does not work)

    #29023

    oro_newbie
    Participant

    I realized what I was missing. Even though I had ‘Custom\Bundle\AccountBundle\Entity\Account:’ declared in my search.yml, the actual Entity\Account file did not exist. So I override it and ran the command:

    and with this the fields from my search.yml started indexing in tables oro_search_item & oro_search_index_text. I guess that’s one good way to check if your search indexed the right fields.

    Though I still get the “Allowed memory size exhausted of … bytes exhausted” error. I guess the only workaround for now is to run the command with offset and limit parameters like:

    which means start from record ID 1 and get 20000 rows and then next

    start from record ID 20000 and get 20000 rows etc.

    Can probably be useful for someone in future.

    #29024

    Mike Kudelya
    Participant

    Try to increase ‘memory_limit’ php directive

    #29025

    oro_newbie
    Participant

    Thank you Mike. Will try that the next time I’m running the command.

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

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top

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

Yes No

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

Yes No