In terms of search capability and performance, what are the pros & cons of implementing tags as an array
or text
or full text field?
I am seeing limitations of capability in choosing to implement tags with an array, because it seems to me that if an array contains ['juicy fruit']
then someone searching for 'fruit'
will not find that record (for example, tags && ARRAY['fruit']
will not find it). The person who created that record would have had to enter something more like ['juicy fruit', 'juicy', 'fruit']
to have their record found with just a search for 'fruit'
or 'juicy'
. Whereas if I implement tags as text
, then a search for 'fruit'
will find 'juicy fruit'
, and further still, if I implement tags as full text then I will find 'juicy fruit'
when searching with the string 'fruits'
(plural). Furthermore, I think there will be no performance loss in going for full text search. Thoughts?
But maybe the whole point of tags is exact match.