Finder plugin - how to add content map

31 views
Skip to first unread message

Nicolas Claverie

unread,
Jul 9, 2024, 4:02:32 AM (14 days ago) Jul 9
to Joomla! General Development
Hi,

I've developed a finder plugin for the Smart Search for HikaShop (I attach it to this message).
Someone reported that the indexation of products was not adding content maps :
I do notice the same behavior on my end. However, I don't understand how the plugin can add things there.
Anyone knows ?

Nicolas
hikashop.zip

Hannes Papenberg

unread,
Jul 9, 2024, 4:14:34 AM (14 days ago) Jul 9
to joomla-de...@googlegroups.com
In your code you already have
//$item->addTaxonomy('Category',     $item->category, $item->cat_state,
$item->cat_access);
but it is commented out. That code adds the cotent map(s). It is either
a key-value-pair of strings or a key-value-pair with the key being a
string and the value being a ImmutableNodeInterface object. The later
allows to store a hierarchy like our categories or for example nested
tags. You can use any string as key or value for the taxonomies as you
want and as many times as you want. In theory, you could create a
complete product directory with filters by this for example. Hope this
helps.

Hannes
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/joomla-dev-general/f1e970b2-4e61-4445-910c-18ee89f189b9n%40googlegroups.com
> <https://groups.google.com/d/msgid/joomla-dev-general/f1e970b2-4e61-4445-910c-18ee89f189b9n%40googlegroups.com?utm_medium=email&utm_source=footer>.


Nicolas Claverie

unread,
Jul 9, 2024, 4:41:14 AM (14 days ago) Jul 9
to Joomla! General Development
Hi,

Thank you for your answer.
Sorry, I think I was not clear enough.
I understand that this line adds the content maps for the category. I didn't want to bother with setting the taxonomy on the categories for now, mainly because a product can be in several categories and I was not sure how to handle that.
However, I already have a addTaxonomy call for the Type:
$item->addTaxonomy('Type', 'Product');
However, the type Product doesn't show up in the content maps listing. That's what I don't understand.

Nicolas

Nicolas Claverie

unread,
Jul 11, 2024, 10:36:46 AM (11 days ago) Jul 11
to Joomla! General Development
Hi,

After mulling over it for the past two days, and with the help of the person reporting the issue on our website, I actually found the solution.
The issue is that in order to handle the indexing in different languages, I make a copy of the item being indexed, one for each language. However, during the copy process, the taxonomies were lost. So the problem was not there when the website was not in multilingual mode, but both my test website and the website of the person reporting the issue were. 

Nicolas
Reply all
Reply to author
Forward
0 new messages