We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    is this an issue with the default driver, too, or only with this custom driver?
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 46456
      • 3 Posts
      Only with this custom driver. Any special character returns no results including the wildcard asterix (searchterm* returns no results, searchterm * does.)
        • 38723
        • 165 Posts
        I've been using this custom search driver on a couple of sites and have had a decent amount of success with it. Just wondering if anybody knows a way to exclude or ONLY include certain template IDs in the search.

        A site I am working on uses getResources extensively and I'd like to easily exclude those 'child' documents from results - using &exclude=`` only seems to work for specific page IDs which is great for removing home, search results, page not found etc but I see no obvious way to restrict search to templates (unless I have just been staring straight at it!!)

        Anybody got any ideas?
          • 4172
          • 5,888 Posts
          does

          &where=`{"template:IN":[1,2,3]}`


          work?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 38723
            • 165 Posts
            Quote from: Bruno17 at Aug 05, 2014, 10:14 AM
            does

            &where=`{"template:IN":[1,2,3]}`


            work?

            I noticed the &where=`` on your first post just after I posted. Yes, this works perfectly! Thank you smiley
              • 50661
              • 1 Posts
              Hello Sir,

              Is there a way to get template variables content in search results?

              [[!SimpleSearch?
              &sisea.driver_class=`simplesearchdriverresourcescustom`
              &sisea.driver_db_specific=`0`
              &searchTvs = `BodyContent,imageandDescription,Team,LatestNews`
              ]]


              I am only getting Pagetitle using this code.
                • 4172
                • 5,888 Posts
                you will need to play with

                &includeTVs and &extractSource

                extractSource can also be a snippet, where you can build the text, from where to get the extract

                //relevant code-part in simpleSearch
                $text = $modx->runSnippet($extractSource, $resourceArray);
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 51058
                  • 4 Posts
                  Quote from: Bruno17 at Dec 04, 2013, 06:00 PM
                  it does!

                  I changed this wrong line:

                  'on' => 'Tags.contentid=modResource.id AND Tags.tmplvarid=' . $tv_id . '');


                  to

                  'on' => $alias . '.contentid=modResource.id AND ' . $alias . '.tmplvarid=' . $tv_id);


                  at the code, copy the whole code again and try it again, please.


                  Hi Bruno, already tried to update this but still wont be able to search my tvs. Here's my query

                  SELECT DISTINCT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `adeci_site_content` AS `modResource` WHERE ( ( `modResource`.`pagetitle` LIKE '%ZDHC%' OR `modResource`.`longtitle` LIKE '%ZDHC%' OR `modResource`.`alias` LIKE '%ZDHC%' OR `modResource`.`description` LIKE '%ZDHC%' OR `modResource`.`introtext` LIKE '%ZDHC%' OR `modResource`.`content` LIKE '%ZDHC%' ) AND `modResource`.`id` != 0 AND `modResource`.`id` != 0 AND ( `modResource`.`published` = 1 AND `modResource`.`searchable` = 1 AND `modResource`.`deleted` = 0 AND `modResource`.`context_key` IN ('web') ) ) ORDER BY modResource.link_attributes DESC LIMIT 10

                  Thank you so much!