This documentation covers only important parts. i-Search have a question mark at almost all setting points with detailed information about the option.

1. Plugin Installation

First, you need to download the plugin from the source (which will be a zip file). Next, you need to go to WordPress admin area and visit Plugins » Add New page.

After that, click on the Upload Plugin button on top of the page.

This will bring you to the plugin upload page. Here you need to click on the choose file button and select the plugin file you downloaded earlier to your computer.

After you have selected the file, you need to click on the install now button.

WordPress will now upload the plugin file from your computer and install it for you. You will see a success message after the installation is finished.

Once installed, you need to click on the Activate Plugin link to start using the plugin.

You would have to configure the settings to fit your needs.

2. First Settings

Click on all4wp plugins -> i-Search to make your first settings.

Almost every option have a help point with detailed informations.

On click you will get detailed informations about that option.

3. Indexing

This is the secret behind i-Search. Unlike other serch plugins i-Search will not look in every post/taxonomy/metakey for a match. i-Search create an index of your site (based on your settings) and look only in this index table for matches. This makes i-Search so fast.

You need a index only if you change some important settings in the i-Search options.

i-Search will warn you if a re-index is needed. Usualy only for the first time an indexing is needed.

By changing post/taxonomy data i-Search will automatically update his index. No need for indexing.

The index procedure can take a while. Please do not abbort the indexing. If you abbort it you need to re-start the indexing procedure.

Tip: While you play with the settings you can update a post or taxonomy and search for the post in the frontend to see the effects. If you finished your settings than do an indexing.

4. Advanced Settings TAB

4.1 Include Meta Keys in search algorithmus.

Here you will see all the meta keys used in your WordPress. Most o fthem are for plugins internal usage. Select only the meta keys you want to be queried in your searches. Example: A book store have an “isbn” meta key with the value “123456789” if you want this meta key to be relevent in searches select it. A search for “123456789” will now include the posts with this isbn number.

4.2 Include Taxonomies in search algorithmus.

The same as above only for taxonomies.

4.3 Exclude words from search algorithmus.

You can exclude words from the search algorithmus by adding them here like WP tags. This is a useful feature if you have not well optimized post tags. Example: You have a book store and almost every product have a “Book” tag. You need to exclude the “book” tag because a search for book will result every product. For a better search optimizing you can exclude wordsa here. Wildcards are allowed: if you want to exclude all words ending with book, type in “*book” or all words include the “book” type in “*book*” . All words beginning or ending with “book” will now excluded from the search.

5. Search Analysis

Exclude words from logging

About the analysis table:
i-Search checks the logs for their validity before displaying the table. This means if you have a not found log but added a post which covers an entrys not found string in the log. The log will be deletet. Dont suprized if a log is no longer available after updating a posts title or tags.

There you can add “Bad words” to exclude from logging. Wildcards are allowed. Example: If you add the word “*asd*” all search queries including the string “asd” will not logged. The visitor will see a “Popular Searches” list or “Nothing Found” (based on your settings).

Info: i-Search will look first in the algo and try to find a match. If no macth found for “asd” then i-search will start logging and check for “Bad words”. This means if you have a product matching to “asd” then the user will get a result.

A screenshot for “asd” search

Analyse Table

The analysis table is a powerful feature of i-Search. Divided in 7 sections:

  1. Searched String: This is the search string with no results. This string will be updated if similar words searched like: ‘otto d’ and another search for ‘otto dix’ will update the first ‘otto d’ to ‘otto dix’ until you make an action for this string. (actions explained later).
  2. Flow: The flow of the user. Example: user searched for ‘otto d’ (with no results) and than searched only for ‘otto’ (with results). Now you will see in the flow section only ‘otto’ (this is the users last not found search query). The brackets are interesting, The user searched for ‘otto’ (with results) and clicked a suggestion now you will see in the brackets the clicked post name.
  3. Action: This area contains your ‘Did you mean’ strings.
  4. Count: How many times different users searched for this string.
  5. Time: The last time a user searched for this string.
  6. Latest IP: The latest users ip address (This is helpfull to detect a users search practice. Sometimes you will have the same ip more times if a user is frustrated and searches and searches…).
  7. Edit Button: A click on this button let you do actions for this string.

The edit button

On click a popup will open and let you do some actions for the string.

  1. Add to bad words: You can add this search string to bad words automatically.
  2. Enter a ‘Did you mean’ string: Enter a string (i-Search will check the entered string for search results. You can not enter a string with no search results). Users with similar searches will now see this ‘Did you mean’ string.
  3. Add this string to a post/taxonomy: To add this string to a posts or taxonomies extra search tags. An autocomplete field will appear start typing your taxonomy name or post name.
  4. Delete: Delete this string from the logs

6. Filters

Info: By adding any filter or changing the function of a filter you need a re-index of your site.

i-Search provides you different useful filters.
More about WP filters

Filter for manipulating the suggestion (Post Types):
isrc_format_output

Filter for manipulating the suggestion (Taxonomies):
isrc_format_output_taxonomy

Filter for adding extra search terms (Post Types):
isrc_post_before_insert

Filter for adding extra search terms (Taxonomies):
isrc_taxonomy_before_insert

Filter: isrc_format_output / isrc_format_output_taxonomy

This filter allows you to manipulate the javascript output of i -Search.

isrc_format_output is called on post update or indexing. The arg contains all the output data as an array.  The post_id is in the arg as “id”.
isrc_format_output_taxonomy is called on taxonomy update or indexing. The arg contains all the output data as an array.  The taxonomy_id is in the arg as “id”.

The arg array will look like:

Array
(
     [id] => 1292
     [url] => https://i-search.all4wp.net/...
     [cnt] => https://i-search.all4wp.net/wp-content
     [img] => /uploads/2018/06/product-1528497893-866511136-46x70.png
     [img2] => /uploads/2018/06/product-1528497893-866511136-93x140.png
     [excerpt] => Non numquam eius modi tempora incidunt...
     [price] =>
     [p_cats] => Bubbles, Classic Games, Scooters
     [value] => Autism Spectrum Disorders: The Comple...
     [ptn] => product
     [type] => post_type
)

You have 7 areas to hook in the javascript:

  1. before_categories (only advanced theme)
  2. before_excerpt (only advanced theme)
  3. after_excerpt (only advanced theme)
  4. before_badges (both themes)
  5. after_badges (both themes)
  6. after_price (both themes)
  7. after_title (both themes)

A php hook must be an associative array. Example funtion to add ‘Author’ to the suggestions after the price.

function your_function_name( $args ){

   $post_id = $args['id'];

   /* get your data */
   $author_name = get_post_meta( $post_id, '_author', true );

   /* build the associative array */
   $author_data = array(
      'label' => 'Author:', /* The label before the string to show */
      'value' => $author_name, /* the value as string to show */
      'hide_on_mobile' => true, /* hide on mobile devices? true/false */
   );

   /* now add your array to the args array which passed to this function on top and will be returned */
   $args['after_price']['author_1'] = $author_data;
   /* the author_1 can be any name. This will be used as the CSS class name in front to be able to style the output */
   /* you can also add more arrays after $args['after_price'] to show more data like: $args['after_price']['author_2'] = $author2_data; */

   return $args;
}

add_filter( 'isrc_format_output','your_function_name', 10, 1 );

Filter: isrc_post_before_insert / isrc_taxonomy_before_insert

This filters are called before the search terms of the current post/taxonomy is inserted into the db. This is a usefull filter if you have your metavalue need more actions to get a search term. i-Search will look for dublicates and filter them out later.

The filter contains only the search terms as an array. You can add or remove data to the array.

Example to add extra search terms to a post/taxonomy:

function your_function_name( $terms, $post_id, $data ){

  /* get your extra data */
  $isbn = get_post_meta( $post_id, 'isbn', true );

  /* append to $terms */
  $terms[] = $isbn;

  return $terms;

}

add_filter('isrc_post_before_insert','your_function_name',10 , 3);

7. Shortcodes

i-Search have 1 shortcode with 2 variables to insert the search field into a post.

[isrc_ajax_search]

To change the default template. Allowed args: clean / advanced
[isrc_ajax_search theme='clean']

To change the default placeholder text. Allowed args: any string
[isrc_ajax_search theme='clean' placeholder='My custom placeholder text']

8. PHP functions

show_i_search_form( $atts = array() )

Shows the search field with PHP.

Example:

<?php

$atts = array(
        'theme' => 'advanced',
        'placeholder' => 'Start searching...'
       );

echo show_i_search_form( $atts );

?>