Search

  • What does it do?

    The jrSearch module adds search functionality to your site.

    The skins get to define how broad or narrow the site search is by the settings they use in the templates.

    Its possible to search everything, or just put a search into a section and search that section only.
  • screenshot of the sitewide search in use by a user searching for something
  • search results being displayed after a sitewide search
  • screenshot of the info tab for the search module in the ACP
  • Development

    If you want to add a search box to a location, there are a couple of functions provided to tap into the Search module system.

    The first function, {jrSearch_form ...} is the site wide search and will be what is wanted for most situations for use in a skin:
    {jrSearch_form class="form_text" value="Search Site" style="width:70%"}
  • The second function is for use by module developers to search just their module. It was created to provide a search box for the modules index.tpl file.

    That function is {jrSearch_module_form ...}
    {jrSearch_module_form module="jrBlog" fields="blog_title,blog_text"}
  • jrSearch_form

    Function
    jrSearch_form
    parameter
    type
    default
    required
    description
    module
    string
    all
    off
    The module within for the search term
    page
    int
    1
    off
    The page of the search results to show
    pagebreak
    int
    4
    off
    How many results to show per page
    value
    string
    search site
    off
    The text to show as a place holder in the search box
    class
    string
    -
    off
    Any classes that should be applied to the search input area
    tpl_dir
    string
    -
    The name of the module directory to use to locate the template="" file if not the current skin
    template
    string
    -
    The name of the custom template to use if not the default.
    method
    string
    post
    POST or GET method for form submission.
    ????
    ?????
    -
    Any other key="value" set you want to add to be passed to the template.
    Site wide search used in the skin templates.
  • jrSearch_module_form

    Function
    jrSearch_module_form
    parameter
    type
    default
    required
    description
    module
    string
    -
    on
    The name of the module to search. (un-necessary inside the modules index.tpl file as its already set by $_post['module'])
    fields
    CSV
    all
    on
    The datastore keys to search for the search term. eg: fields="blog_title,blog_text"
    template
    string
    -
    An optional template file to use to customize the layout of the input box. Place file in the active skin to use.
    A search form that targets specific module datastore key to target when searching.
  • Tab: Global Config

    On the Global Config tab of the Search module in the ACP you will find options to configure how the search results are returned.

  • screenshot of the Global Config tab in the ACP
  • An important option to know about is the Additional Search Fields as it allows you to include any extra fields that are stored in the datastore in the search results.

    This is useful if you use the Form Designer to add additional fields to forms which you want to be checked for in search results.

    The info for the Additional Search Fields is this:
    Quote: If you would like to have additional DataStore fields available for search, enter the DataStore field name, one per line.

    Example:
    If you have created a custom User Profiles field via the Form Designer called "profile_location" you would enter profile_location on a line by itself to enable that field to be searched.

    You may also include an optional weight value that will make the search field have more impact on the search results:

    profile_location,10

    Would set the weight for the profile_location field to 10, which means a search match on that field would be 10 times more important than the default value of 1.
  • If the results dont show up, try rebuilding the search index via the tool at:
    ACP -> MODULES -> LISTING -> SEARCH -> TOOLS -> REBUILD INDEX

Tags