We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    This is an auto-generated topic for AjaxSearch 1.9.2b-Finale by coroico.

    Brief Description:

    Ajax and non-Ajax search that supports results highlighting
    See:
    - ajaxSearch_version_192b.txt : release note with bugs fixed since 1.9.1
    - ajaxSearch_readme.txt : gobal presentation of AjaxSearch
    - cheatSheet : a quick overview of AjaxSearch parameters.
    - /documentation/migrationFrom185To190.txt : how to migrate from 1.8.5 to 1.9.0 (and then to 1.9.2)
    - Bugs & features tracker : http://bugs.modx.com/projects/evo
    - Demo site : http://www.evo.wangba.fr


      • 20135
      • 188 Posts
      Extend AjaxSearch to Easy2Gallery
      Hi, I’m trying to extend AjaxSearch 1.92b to search through the easy2_files table by emulating the process used for the maxigallery integration, but it doesn’t want to work. What’s the best way of going about this?

      So far I’ve added the following in ajaxSearchRequest.class.inc.php at line 215:
                  case 'easy2gallery':
                      $this->scJoined[] = array(
                          'tb_name' => $this->_getShortTableName('easy2_files'),
                          'tb_alias' => 'e2g_f',
                          'id' => 'id',
                          'main' => 'id',
                          'join' => 'dir_id',
                          'searchable' => array('filename', 'alias', 'description', 'summary'),
                          'displayed' => array('alias', 'description'),
                          'concat_separator' => ', ',
                          'filters' => array()
                      );
                      $j = count($this->scJoined) - 1;
                      if ($pfields != '') {
                          unset($this->scJoined[$j]['searchable']);
                          if ($pfields == 'null' or $pfields == 'NULL') $this->scJoined[$j]['searchable'] = array();
                          else $this->scJoined[$j]['searchable'] = explode(',', $pfields);
                      }
      
                      /*$j = count($this->scJoined) - 1;
                      $this->scJoined[$j]['filters'][] = array('field' => 'status', 'oper' => '=', 'value' => '1');
                      break;*/
      

      edited the following in ajaxSearchResults.class.inc.php at line 207:
                          if (($tbcode != 'content') && ($tbcode != 'tv') && ($tbcode != 'jot') && ($tbcode != 'maxigallery') && ($tbcode != 'easy2gallery') && !function_exists($tbcode)) {
      

      added the following in search.class.inc.php at line 698:
      		// Easy2Gallery ================================= search in E2G image gallery
              case 'maxigallery':
                $this->joined[] = array(
                    'tb_name' => $this->getShortTableName('easy2_files'),
                    'tb_alias' => 'gal',
                    'id' => 'id',
                    'main' => 'id',
                    'join' => 'dir_id',
                    'searchable' => array('filename', 'alias', 'description', 'summary'),
                    'displayed' => array('alias', 'description'),
                    'concat_separator' => ', ',
                    'filters' => array()
                );
                $j = count($this->joined) - 1;
                if ($pfields != '' ) {
                  unset($this->joined[$j]['searchable']);
                  if ($pfields == 'null' or $pfields == 'NULL') $this->main['searchable'] = array();
                  else $this->main['searchable'] = explode(',',$pfields); // overwrite the default values
                }
                /*// image should be published
                $j = count($this->joined) - 1;
                $this->joined[$j]['filters'][] = array(
                    'field' => 'status',
                    'oper' => '=',
                    'value' => '1'  
                );       */   
                break;
      


      My snippet call is [!AjaxSearch? &showResults=`0` &ajaxSearch=`0` &landingPage=`264` &highlightResult=`0` &tplInput=`searchv2Tpl` &whereSearch=`content|tv|easy2_files:filename,summary,description,alias` &debug=`3` !].

      What have I missed?
        • 36744
        • 2 Posts
        ок. I tested it:
        AjaxSearch error: table easy2_files not defined in the configuration file: !
          • 3647
          • 177 Posts
          Hi
          Don't suppose you could paste the code you added to the configuration file - I think it might help me with what I'm working on if I could see it!
            • 42378
            • 4 Posts
            Hello! I am having some issues on some test sites i have tried in local environment. The modx version is: evo 1.6 and ajaxsearch versions are: 1.9.2-pl and 1.9.3.

            I am trying to search through content and user comments in the same time. I have used the whereSearch and extract parameters. When ajaxmode is on, it works fine. But when i use non-ajax mode, then users' comments won't be searched. This is my snippet call:

            [!AjaxSearch? &ajaxSearch=`0` &showResults=`0` &landingPage =`73` &jscript=`jquery` &clearDefault=`1` &showIntro=`0` &whereSearch=`content|tv:tv_value|jot:jot_content` &extract=`88:pagetitle,content,introtext,jot_content,tv_value`!]


            I have also tried with:
            [!AjaxSearch? &ajaxSearch=`0` &showResults=`0` &landingPage =`73` &whereSearch=`content|tv|jot` &extract=`5:pagetitle,content,introtext,jot_content,tv_value`!]


            Is anyone else having the same problem as i have?