Comment to 'Keyword Search'
Comment to Keyword Search
  • Hello Scholar !

    You may set the value of the "GlobalSearch" field for the Timeline records as 0 in the table `sys_objects_search`. As the search keyword page shows only the containers of found search results from the necessary app you may edit only the method getResultsContainer form the BxTemplSearch class.

    • No, then you'd better redeclare the method getKeyTitlesPairs in the BxTemplSearch class of your template. It should have a look like:

      private function getKeyTitlesPairs ()

          {

              $a = array();

              foreach ($this->aClasses as $sKey => $r)

      if ($sKey == 'bx_timeline' || $sKey == 'bx_timeline_cmts')

      continue;

                  if ($this->_sMetaType || $r['GlobalSearch'])

                      $a[$sKey] = _t($r['title']);

              return $a;

          }

      The bold part is the addon to exclude Timeline and Timeline comments form the search keyword form.

      • No, then you'd better redeclare the method getKeyTitlesPairs in the BxTemplSearch class of your template. It should have a look like:

        private function getKeyTitlesPairs ()

            {

                $a = array();

                foreach ($this->aClasses as $sKey => $r)

        if ($sKey == 'bx_timeline' || $sKey == 'bx_timeline_cmts')

        continue;

                    if ($this->_sMetaType || $r['GlobalSearch'])

                        $a[$sKey] = _t($r['title']);

                return $a;

            }

        The bold part is the addon to exclude Timeline and Timeline comments form the search keyword form.

        Thanks LeonidS . getKeyTitlesPairs () changes the list of options/vlaues appearing under 'Section' of the search form only, but does not exclude timeline from search results when the 'global search' / 'select all' option is chosen. it sounds that we need to do something with the public function getForm() with BxBaseSearch class. any ideas?

        • Then you need to exclude Timeline in this part of response method

          if (!$this->_sMetaType && !$aValue['GlobalSearch'])

                          continue;

          or directly in the __construct in this part:

          $this->aClasses = BxDolDb::getInstance()->fromCache('sys_objects_search', 'getAllWithKey',

                     'SELECT `ID` as `id`,

                             `Title` as `title`,

                             `ClassName` as `class`,

                             `ClassPath` as `file`,

                             `ObjectName`,

                             `GlobalSearch`

                      FROM `sys_objects_search`

                      ORDER BY `Order` ASC', 'ObjectName'

                  );