Set up Mouse
It’s time to set up your search engine after uploading Mouse. Write
in the Aneamal file where you want the search engine with its search box and search results to be located. The address of your homepage needs to start with https or http. Also write
into the same file, if you want to use the Mouse standard design for the search box.
In the beginning there will hardly be results for your searches.
The Mouse crawler will explore your website starting at the homepage. It will follow links and fetch the web pages over the internet like a human reader to analyze and register their content in its database. Mouse creates the database together with other files in your /aneamal/private/mouse/ directory. The directory needs to be writable; further attention is not needed there.
Building the database takes time. The Mouse crawler analyzes one of your pages about every half minute, if it is triggered. The crawler is triggered every time the search is used. However, this may be a bit too slow for you, especially if your website consists of many pages and you do not want to publish the search engine yet while it only finds few results. So there are alternative ways to trigger the crawler:
Trigger the crawler with a web-cronjob
Enter a question mark
? into the search box and hit the search button. You will get the Crawler’s URL which looks like this:
Make a web-cronjob service request this URL regularly. Some web-cronjob providers do this for free. One page of your website is analyzed each time the URL is requested. So an hourly cronjob causes 24 pages to be crawled every day while a cronjob that runs every minute gets up to 1440 pages into your database in a day …
Trigger the crawler by website visitors
Enter a question mark
? into the search box and hit the search button. Besides the Crawler’s URL you will get the line Trigger in Aneamal that looks like this:
Trigger the crawler with a serverside cronjob
For advanced webmasters: You may have the option to set up a classic cronjob in the operating system of your server which runs PHP from the command line. You will have to provide two parameters when calling PHP: the absolute file path of the Mouse crawler and a code for the search realm. This looks somewhat like:
/usr/bin/php /home/www/aneamal/x-mouse/crawl.php rod3nt5
You would borrow the highlighted parts from the Crawler’s URL, for example:
Mind that the question mark in the Crawler’s URL must be replaced by a space when running PHP from the command line. Get yourself support for setting up the cronjob and finding the correct file paths, if needed. The paths differ from server to server.
Next step: Search with Mouse