We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6855
    • 11 Posts
    Hello,

    I’d like AjaxSearch to be able to search in user comments too. I use Jot for comments.
    Is it doable?

    Thanks.
      • 5811
      • 1,717 Posts
      ---- &whereSearch : [comma separated list of key | content,tv] (optional)
      define in which tables the search occurs
      by default in documents and TVs
      other predefined key: jot, maxigallery
      by default all the text fields are searchable but you could specify the fields like this:
      whereSearch=`content:pagetitle,introtext,content|tv:tv_value|maxigallery:gal_title`

      So use &whereSearch=`content,tv,jot`

      You could define your extract with the &extract parameter:

      ---- &extract [int : Comma separated list of displayable fields | ’1:content,description,introtext,tv_value] (optional)

      Define the maximum number of extracts that will be displayed per
      document and define which fields will be used to set up extracts

      An extract is a bit of text where search term have been found (and may be highlighted).
      &extract is different of &whereSearch.
      &extract define which fields will be used to set up the text where to extract the search term.
      &whereSearch define which tables use for the search (and then provides a list of displayable
      fields where to search and possibly used by &extract)

      &extract : `int : Comma separated list of searchable fields`

      int:
      0 - no extract
      n - n extracts allowed per document.

      Comma separated list of displayable fields:
      The field names used for the extract come from the "displayed" fields of
      tables defined by the &whereSearch parameter (main and joined tables)

      Searchable fields are string type fields that can could contain the search terms.

      For "content", the searcheable fields available are:
      pagetitle, longtitle, description, alias, introtext, menutitle, content

      For "tv", the fields available are :
      tv_value which is a concatenation of all the tv "values" field

      For "jot", the fields available are :
      jot_content which a concatenation of all the "content" fields of jot table

      For "maxigallery", the fields available are :
      gal_title, gal_descr which are a concatenation of title & descr fields of maxigallery table

      e.g: &extract=`5:description,introtext,content,tv_value`
      allows a maximum of 5 extracts per document found by search.
      Extracts display content from description,introtext,content of document AND
      tv_value from all the TV linked with the document

      e.g: &whereSearch=`content,maxigallery` &extract=`10:galtitle,galdescr`
      allows a maximum of 10 extracts per document found by search.
      Extract are built by parsing ONLY the fields title and descr of maxigallery

      e.g: &whereSearch=`content,tv,jot` &extract=`tv_value,jot_content`
      allows a maximum of 1 extract per document found by search (by default)
      Extracts display content from tv_value (TV values) and jot_content (comment)

      e.g &whereSearch=`product,shop` &extract=`name,shop_name,shop_address`
      In this example, product and shop are customs tables (defined in config file)
      Extracts display content from name (product), shop_name and shop address(shop)


      With 1.8.1 look at http://www.modx.wangba.fr/index.php?id=200
      With 1.8.2 look at http://www.modx.wangba.fr/index.php?id=247

      and last but not least the wiki documentation : http://wiki.modxcms.com/index.php/AjaxSearch
        • 6855
        • 11 Posts
        Thanks!! (and sorry for asking something that was already in the modx doc)
        AjaxSearch is really powerful cool
        It’s a pleasure to work with tools like that.