简体   繁体   中英

How to search json column in Sonata?

I have column in my db where data looks like this "{"cs":"Lékař","en":"Doctor","_type":"translated"}" I need to perform fulltext search like shown in screenshot and I have no idea how to do it. Is there any way how to extract data from db and then perform search on this? I couldn't find any mention of it in documentation. Maybe there is some simple solution which I can't see, thank you for your help. 在此处输入图像描述

I tried to solve it by raw sql query but sonata for it's filters expects instance of QueryBuilder. I also tried to change column's collation, but it didn't help.

It turned out I'm completely blind. If somebody would run into this problem in the future, there is possibility to create custom filter like it is described here. https://docs.sonata-project.org/projects/SonataDoctrineORMAdminBundle/en/4.x/reference/filter_field_definition/#jsonlistfilter-and-custom-filters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM