<![CDATA[ AdvSearch + Tagger and using fieldPotency - My Forums]]> https://forums.modx.com/thread/?thread=97772 <![CDATA[AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528730
This is the snippet:

<?php

$modxTablePrefix = 'modx_';
$taggerModelPath = '{core_path}components/tagger/model/';

$hook->setQueryHook(array(
    'qhVersion' => '1.2',
    'joined' => array(
        array(
            'package' => 'tagger',
            'class' => 'TaggerTagResource',
            'packagePath' => $taggerModelPath,
            'withFields' => 'resource',
            'tablePrefix' => $modxTablePrefix,
            'joinCriteria' => 'TaggerTagResource.resource = modResource.id'
        ),
        array(
            'package' => 'tagger',
            'class' => 'TaggerTag',
            'packagePath' => $taggerModelPath,
            'withFields' => 'tag',
            'tablePrefix' => $modxTablePrefix,
            'joinCriteria' => 'TaggerTag.id = TaggerTagResource.tag'
        ),
    )
));

return true;  


And this is the advSearch snippet call. It works, however I can't get fieldPotency to take the Tagger field. I tried this:

[[!AdvSearch?
&hideContainers=`0`
&minChars=`2`
&fields=`pagetitle,content,introtext`
&withFields=`pagetitle,content,introtext,description`
&highlightTag=`strong`
&searchIndex=`zoekterm`
&perPage=`10`
&engine=`mysql`
&pagingType=`1`
&pagingSeparator=``
&showExtract=`1:introtext,content`
&addCss=`0`
&addJs=`0`
&toPlaceholder=`searchresults`
&init=`all`
&offsetIndex=`start`
&queryHook=`searchTagger`
&fieldPotency=`pagetitle:100, tag:80, content:50, introtext:30, description:10`
&sortby=`score DESC`
]]


The problem is first of all I don't know how to reference the Tagger field (used 'tag', but not sure if that's correct) and second of all I don't know if it's possible to use a joined field in the fieldPotency field. For now, this example isn't working. The resource with a value in Tagger that is searched for IS found, but it's not on top of the list, as I would expect because of the fieldPotency.

Does anyone know if it's possible, and if so what I should do exactly?

Thanks a lot!]]>
michelle84 Jul 22, 2015, 07:28 AM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528730
<![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-563339 Quote from: michelle84 at Aug 14, 2015, 09:19 AM
I would still be interested in the answer to my question above about joining Tagger, but I've solved the problem another way right now with a plugin that copies the Tagger values to a tv, which I can easily use in AdvSearch.
Hello Michelle, I am struggling with the same problem to get SimpleSearch to search in Tagger, and no solution yet. Can you explain how I can get the Tagger values in a tv?]]>
roelbogaards Dec 20, 2018, 08:54 PM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-563339
<![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-530046 michelle84 Aug 14, 2015, 09:19 AM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-530046 <![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-530038
I'm still struggling with this, hope you have time to give me a hand.
I looked at the indexation script, but I don't see how it would help since the Tagger addon doesn't use TV's to store the values. Am I understanding this wrong?

The values from Tagger are only searchable because I joined the table in the Advsearch call with a query hook. That works, but can Advsearch use values from a joined table for the fieldpotency or is it impossible?

]]>
michelle84 Aug 14, 2015, 07:34 AM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-530038
<![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-529058
]]>
goldsky Jul 28, 2015, 04:53 AM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-529058
<![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528764
Would you be so kind as to explain a little more about it and what snippet call etcetera I should use to make it work?]]>
michelle84 Jul 22, 2015, 04:11 PM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528764
<![CDATA[Re: AdvSearch + Tagger and using fieldPotency]]> https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528760 goldsky Jul 22, 2015, 03:29 PM https://forums.modx.com/thread/97772/advsearch-tagger-and-using-fieldpotency#dis-post-528760