Indexer foregoes the need for complicated MySQL databases, complex configuration, tedious data entry, specialist web server setups or reliance on big search engine companies. Indexer is your very own search engine, completely self-contained within your website.
Much emphasis is placed on ease of setup, the ability to index almost any size of website, and return highly accurate search results. It's envisioned that most RapidWeaver users of any moderate skill level will have no difficulties with using Indexer.
This clever stack is simply dragged-and-dropped into the page where you want your search results shown. Indexer takes your existing sitemap.xml file (generated by RapidWeaver) and the meta data content you are already feeding search engines (like Google) and social media platforms.
With this content available, Indexer uses its own search spider to visit each page and constructs a flat-file database. With some behind-the-scenes PHP wizardry, Indexer converts this resulting database into an instant 'live search' system.
We're not talking about filtering search results from one single webpage; but a search stack that covers your entire website, plus any other extra webpages or resources you might decide to list. The capabilities of Indexer far exceed other search stacks.
Indexer was built exclusively for RapidWeaver, in response to RapidWeaver 8 adding support for OG (Open Graph) meta data tags. These meta tags provide a convenient summary of every webpage, which can be used for searching a website.
Much emphasis is placed on ease of setup, the ability to index almost any size of website, and return highly accurate search results. It's envisioned that most RapidWeaver users of any moderate skill level will have no difficulties with using Indexer.
This clever stack is simply dragged-and-dropped into the page where you want your search results shown. Indexer takes your existing sitemap.xml file (generated by RapidWeaver) and the meta data content you are already feeding search engines (like Google) and social media platforms.
With this content available, Indexer uses its own search spider to visit each page and constructs a flat-file database. With some behind-the-scenes PHP wizardry, Indexer converts this resulting database into an instant 'live search' system.
We're not talking about filtering search results from one single webpage; but a search stack that covers your entire website, plus any other extra webpages or resources you might decide to list. The capabilities of Indexer far exceed other search stacks.
Indexer was built exclusively for RapidWeaver, in response to RapidWeaver 8 adding support for OG (Open Graph) meta data tags. These meta tags provide a convenient summary of every webpage, which can be used for searching a website.
Example
The Stacks4Stacks website uses Indexer for its own search function. Indexer was found to be the perfect solution for indexing all 150+ webpages on this website. You can hopefully see search function works quickly for finding different stacks.The search box you see above is actually created using the free GlobalSearch stack. GlobalSearch and Indexer can work perfectly together. GlobalSearch offers a method of setting up a stylish search box, which can send user search queries to your Indexer page.
Pre-flight checks
Before using Indexer, please check the following carefully:- You have Stacks v4 or later installed in RapidWeaver.
- RapidWeaver is configured (in your site settings) to generate a sitemap.xml file.
- The website address in your site settings is correct.
- Every page you want shown in your search results has a good title, meta keywords and meta description tags.
- There are no difficulties with broken links or missing webpages.
- Your web server is running PHP v7.3 or later (use UsefulStack to confirm or ask your hosting company for clarification).
Indexer stack is designed for use in Stacks and RapidWeaver only. This stack is not compatible for installation into Wordpress, Blocs, Drupal, Flow or other publishing platforms. Paid help is available if you need a variant of Indexer to be made to work somewhere else. Please make use of the provided free trial version, to ensure Indexer meets your requirements and is a stack you are comfortable with using.
Indexer has three possible methods for indexing websites, based on different server configurations. If one method fails, it will attempt to use another. However there certainly will be some web server setups out there, where Indexer is perhaps not compatible. In which case, SimpleSearch might be a better stack for you to test.
Setup
Follow these instructions for using the demo or full versions of Indexer in your RapidWeaver website:- Add a new Stacks page type to your website (if you don't have one already) and make this your new, dedicated, search page. Give the page a suitable name and link, in the page settings.
- Open the Stacks Library and search for Indexer. Drag and drop a copy into your webpage.
- Remaining in edit mode and with the Stacks side panel open, access your Indexer settings. Choose your sitemap source from the options menu.
- Preview your webpage or publish your new webpage, to your web server.
- Press and hold the search box with your mouse, to reveal the 'Admin Console'.
- Follow the written instructions for building your search index. You would follow this same procedure for rebuilding the search index each time you add new pages to your website or need to update the search database.
- Returning to RapidWeaver again, you will find many other style and behavioural settings you are welcome to change. All settings have little informational tooltips, to explain what they do. All the button options and instructions can be translated into other languages.
The time it takes to build the search database varies, depending on the size of the website, the speed of the web server, the amount of data, and other factors. Typically a website of one hundred webpages will index in less-than a minute.
If you create a search database in RapidWeaver preview, you will still be required to create one on your actual website, after the website is published to the hosting server. If indexing of your website fails in RapidWeaver preview with 'fatal' errors, try using MAMP or publishing to a real web server instead.
Potentially anybody can access the 'Admin Console'. The most damage they could cause would be to rebuild the search index! The admin console can be disabled in the stack settings, if you will not be wanting to use it often. It's also possible to limit its access via a tracking cookie; whereby the Admin Console would be kept hidden unless the web browser contains a matching cookie generated by a stack like CookieManager or MiniCookie.
To create a search box on other webpages that can utilise your Indexer stack, please download and use the free GlobalSearch stack. Set the SearchBox stack to link to your webpage that contains Indexer.
Hiding or applying unique styling to certain search results
On the webpages that you want to hide or style differently with Indexer, add this meta tag to the head section of that page:<meta name="indexer-stack" content="hide-this">
In this example, the content of the meta-tag was set to hide-this. This provides a convenient method of tagging particular pages with certain keywords. When Indexer builds its database, these extra tags (if provided) are added to the search database, alongside the other page data.
When the search results page is generated, these tags get applied to the opening container of the search result. Therefore it becomes an easy task to write your own CSS code (on the search page) to hide particular results or provide other unique styling on them:
.hide-this {
display: none !important;
}
Manually adding search results
You may wish to manually add extra items to your search results, which do not ordinarily feature in your sitemap or website navigation. Such examples could include password-protected pages, blog articles, webpages from a sub-domain, video clips, audio tracks, or file downloads. This is easily accomplished by scrolling down to the Indexer Advanced Settings and enabling the Add Search Listings Manually.You are now presented with a blue button in edit mode. Pressing this button manually adds a new search result to the page. In the Stacks side panel, there are input fields for each piece of data.
Manually-added search results can only be edited in RapidWeaver. Rebuilding the search database on the web server has no effect on items you have manually added.
Using custom DOM elements in search results [advanced]
In its basic configuration, Indexer uses the page title and standard meta data (e.g. meta description and meta keywords) of each webpage, in its search index. These are often available and if you have search engine optimised your website, then these meta tags should already contain good quality content to aid searching. We purposefully do not index the content of whole webpages, because this would drastically slow-down indexing speeds and quite possibly result in the creation of huge data files that are simply impossible to search efficiently.However it is possible for you to instruct Indexer to include search data from other parts of your webpages, like custom meta tags and headlines. Indexer is already using the PHP Simple HTML DOM Parser system to fetch the basic data it needs. Through use of custom DOM elements and parsers, it is possible to extend the searching to include other custom elements.
In the case of using custom meta tags you have added to webpages, you could set the DOM element to
head meta[name='product-size']
where product-size
is the name of the custom meta tag. Set the parser to Content, so that the content value of the custom meta tag is fetched.You could get the content of your theme sidebars in a similar way. Assuming your theme wrapped the sidebar content inside an ID with a value of
sidebar
, then we could set the DOM element to div[id=sidebar]
and set the parser to Inner Content, so it fetches the content between the opening and closing tags.Or as a third example, you could fetch the blog archive cloud links, form a RapidWeaver blog page using
div[class=blog-tag-cloud]
as the DOM element and again using Inner Text as the parser.For more examples of how you can traverse the DOM and extract certain pieces of content to use in your search database, please see the PHP Simple HTML DOM Parser Manual, for the full documentation.