Search Engine Studio FAQ

Question ID:
Q2025
Question:
How can I allow the user to choose which section of the website to search in?
 
You will generally need to go to the 'Search Box Builder' (Search Engine menu -> Edit search box). In the list of available search box items, there are two that can be used to let the user choose the scope of search:
  • URL filter -- this is the easiest way to accomplish the task. By specifying different URL filters, (e.g. "http://www.website.com/dir1/, http://www.website.com/dir2/, NONE") you can very simply limit the search scope (in this case to dir1, dir2 or all directories of website). If you want to include documents from two or three directories at the same time, separate them with the star sign, e.g.: "http://www.website.com/dir1/*http://www.website.com/dir2/" as a single entry. Even though this solution is sufficient in vast majority of cases, it will not let you perform advanced filtering (based on other criteria as well).
  • Database choice -- by using this filter you can very precisely specify the search scope. Here's how this works: you will need to create multiple Search Engine Studio projects (.ses files), each one with a different "section" (or document set) of the website having been indexed (indexer is very flexible in filtering out documents, see Q2024 for more details). In each of these projects, in options / search engine / database prefix you will need to specify a unique prefix, e.g. set1, set2, set3 etc. When you generate the output files for each such project, different database sets will be generated by the program -- e.g. set1dbX.sdb, set2dbX.sdb, set3dbX.sdb. You should have these database files generated in the same directory on local/network disk or FTP server. Once you have different sets of .sdb (database) files, in your main project (this can be one of the setX projects) add the 'database choice' filter to the search box. You will need to list all available prefixes so the user has access to all different document/database sets.