Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Search to Your Site
08-01-2013, 03:19 PM
Post: #1
Adding Search to Your Site
clearFusionCMS is shipped with a search engine capable of searching content in all of the modules that are installed on your website, it then returns the results in a unified fashion to the searcher.

clearFusionCMS allows you to choose what items are indexed and which are not, you may choose not to index items in your gallery but index all the information in your news feeds.

To add search to your site:
  1. Create a document and call it search results, in the content area add [[!search.results]]
  2. Save the new document and record its document ID, in this example we'll assume the ID is 456
  3. Next add the snippet [[!search.form &resultsPage=`456`]] to your template(s) where you wish the search form to show, 456 will need to be replaced with the document ID from step 1
  4. Reload your site and there should now be a search box showing, entering a term in it will search all your documents and output the results to the search results page that was created in step 1

On initial installation the search will only search Documents for information, it will not search within additional modules until you enable it to do so.
  • From the dashboard select Settings > Search > Search Fields
  • For the Title search field select the fields from all the modules that you require to be indexed as titles
  • For the content field, select all the fields from all the modules that you require to be indexed as content
  • Click Update Search Fields
  • At this point new content created will be indexed within the search, however existing content will not be included until the content has been reindexed
  • Still under Settings, choose clearFusionCMS > Rebuild Search and click Reindex Content
  • It can take from a few seconds to several minutes to index your sites content depending on how fast your hosting is and how much data you have.
Now when you perform a search all indexed content will be searched and results will be a mix from all of the content within the system.

You can give the searcher more control over what information is being searched by adding the &adv=`1` parameter to the [[!search.form]] snippet to enable advanced searches, this will allow searchers to limit their searches to just the fields they select e.g. search just within content titles.

You can add additional search fields from Settings > Search > Search Fields, for example you may choose to add a SKU field which only indexes the SKU of your products, doing so will allow your users to search on just the SKU ignoring the information contained within titles and other content.

clearFusionCMS Lead Developer
Find all posts by this user
Quote this message in a reply
03-10-2017, 04:21 PM (This post was last modified: 03-10-2017 04:23 PM by LittleDogAlex11.)
Post: #2
RE: Adding Search to Your Site
Pretty straightforward tutorial, I have just added the search feature to my site. Seems to work just fine. Thanks!
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)