Search Templates

Search Templates

The templates available in SearchBlox are as follows:

  • category.xsl
  • clustered.xsl
  • default.xsl
  • eml.xsl
  • featured_results_top.xsl
  • frame.xsl
  • graph.xsl
  • highlight.xsl
  • opensearch.xsl
  • pagesort.xsl
  • rss.xsl
  • rss2.xsl
  • tabbed.xsl
  • url.xsl

The user can view the results in the corresponding template by providing the parameter xsl=template.xsl
For example, if you want to view the results in url.xsl format then the Search Servlet URL should be:
https://localhost:8080/searchblox/servlet/SearchServlet?query=test&xsl=url.xsl

All Stylesheets for regular search are available in <SEARCHBLOX_INSTALLATION_PATH>/webapps/searchblox/stylesheets folder.

816

Similarly, you can view the results in xml or json by providing the parameters
xsl=xml
xsl=json
Example:
https://localhost:8080/searchblox/servlet/SearchServlet?query=test&xsl=xml
https://localhost:8080/searchblox/servlet/SearchServlet?query=test&xsl=json

Additional details on templates

  • By default, default.xml is used as the template when using regular search
    https://localhost:8080/searchblox/search.jsp
  • To get the featured results in regular search, the parameter xsl=featured_results_top.xsl is used.
  • url.xsl can be used to get only the URLs of the search results

Customizing Default Style

  • To customize the look and feel of the search results page, edit the default.xsl file under the stylesheets folder.
  • To replace the SearchBlox logo with a company’s logo, find “logo.jpg” in the XSL file and replace it with a jpeg of the company’s logo.
  • Place the company’s logo image file in the images folder under SearchBlox.
  • To change other look and feel aspects of the page, edit the HTML as required.

Changing Search Results Display

  • The default XSL to be used can be specified in the Results page of the Admin Console. To add a new template, place the style sheet file in the <SEARCHBLOX_INSTALLATION_PATH>/webapps/searchblox/stylesheets folder.
  • To use a different XSL style sheet dynamically, pass the XSL parameter as part of the search request. For example:
    http://localhost:8080/searchblox/SearchServlet?query=time&xsl=new.xsl

What’s Next