strapi-plugin-fuzzy-search icon indicating copy to clipboard operation
strapi-plugin-fuzzy-search copied to clipboard

Is it possible to query component content type?

Open siemen-subbaiah opened this issue 2 years ago • 4 comments

I have a component content type in my collection and the component has a single text field, so is there any way to search the text field which resides inside the component?

siemen-subbaiah avatar Jun 28 '22 14:06 siemen-subbaiah

Hello @siemen-subbaiah ! Thank you for bringing this up. At the moment this sadly is not possible but I think it is an important feature the plugin should provide. I will see that I can include this feature in the next release and will let you know where once it's published.

DomDew avatar Jun 29 '22 10:06 DomDew

👋 Hey there! Is there any update on this? Most of my content is within a component in a dynamic zone. I would love to use this plugin! (I also use the Strapi SEO plugin, it would be awesome if one could include the SEO keywords into the keys!)

douwepausma avatar Dec 08 '23 12:12 douwepausma

As a workaround, you can add a simple hidden text field to the content type in question (e.g. search_text). Then in the beforeCreate & beforeUpdate lifecycle hooks update the hidden field value to match the content from the dynamic zone / component in a plaintext format.

That way you can target fuzzy search to the extra text-field instead of the nested value. Not perhaps a 100% ideal solution but at least it works.

ijlind avatar Dec 27 '23 13:12 ijlind

Is this feature supported now?

zjy365 avatar Jul 07 '24 14:07 zjy365