Keyword search within entire Domain Model possible?

0
Hi, I need a search field on the main page where the end user can enter a keyword. Based on that keyword the main entity and associated entities (one or several) should be searched if their attributes contain the keyword. The result should be the main object, the entiry and attribute shown where this keyword was found. Is there a widget or a described workaround for that? (I couldn't find any...) E.g: User likes to search for "dog". HansMuster (nameMain) has an associated document which contains "dog" in the shortDescritpionDoc. Result on a view: nameMain, Entity, nameDoc   Thanks for any thoughts on that. Cheers, Mauro  
asked
1 answers
1

Hi Mauro, 

 

This is not possible when you use the default search on the datagrid. An alternative:

  • Create an extra string attribute in entity Main called searchstring
  • Create a before commit microflow
  • In the before commit: retrieve the associated Documents via Documents_Main
  • Populate the searchstring attribute with all the shortDescriptionDoc by iterating over Documents (maybe comma separated)
  • On a datagrid, put a searchfield for searchstring and set the comparison to contains
answered