Hi Laxmikath,
Instead of appending the structure manually, I think you could enhance using AET.
This way you do not have to add extra code to filter the result.
When adding field using AET, make the field search/result relevant.
Once the field is added using AET, make the field available in search/result view configuration.
Regards,
Sanjay