We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51481
    • 45 Posts
    My SimpleSearch results don't have anything displayed for [[+pagetitle]] or [[+longtitle]]. I am using SimpleSearchDriverSolr if that has any effect on things. Here's my SimpleSearch call:
    [[!SimpleSearch?
        &tpl=`mySearchResult`
        &highlightResults=`1`
        &showExtract=`1`
        &processTVs=`1`
        &urlScheme=`http`
    ]]

    and my mySearchResult tpl:
    <div class="sisea-result">
        <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
        <div class="extract"><p>[[+extract]]</p></div>
    </div>

    It's just the default as I only made it to test (I inputted bogus text in place of [[+pagetitle]] and my bogus text displayed).

    When I switch to SimpleSearchDriverBasic, everything works fine and no errors are displayed. However, using the SimpleSearchDriverSolr the [[+pagetitle]] field can not be shown. I made a couple edits to the simplesearchdriversolr.class.php file:
            /* handle contexts */
    /*
            $contexts = $this->modx->getOption('contexts',$scriptProperties,'');
            $contexts = !empty($contexts) ? $contexts : $this->modx->context->get('key');
            $contexts = implode(' ',explode(',',$contexts));
        	$query->addFilterQuery('context_key:('.$contexts.')');
    */

    I commented this out as it was not allowing my indexed PDF files into search results
            /* basic always-on conditions */
    /*
            $query->addFilterQuery('published:1');
            $query->addFilterQuery('searchable:1');
            $query->addFilterQuery('deleted:0');
    */

    I commented this out as for some reason it would always just return zero results (even though the fq values should have matched my hits)

    Help? [ed. note: matthewmeredith last edited this post 7 years, 10 months ago.]