User Manual / CNSearch 1.5.1
3 Working with the System
CNSearch is comprised of two parts - an indexer and a search module module. The indexer analyses a web-site (or a group of sites) where one are going to search and creates an index file; the Search module performs a quick search in the created index file.
To start the indexing one should perform the following actions:
- Enter the Job name (any) and the address of the web-site for indexing in search.conf file:
Figure 1 Setting the indexing parameters
there localhost is a name of a job, and http://localhost/my_site is the web-site address.
- Run indexer.exe in the command line, defining the following parameters:
- Name of the job;
- Name of the configuration file and its location (in case it is located in another directory).
Example for Windows:
C:\indexer.exe --config=D:\www\search.conf localhost
Example for Unix/Linux:
./indexer.exe --config=/home/www/search.conf name_of_task
To perform indexing of several sites at once, one should enter the sites` URLs within one job in search.conf:
Figure 2 Setting up several sites indexing
Having finished the indexing the system creates the following set of index files:
- files.cns - description of all documents of the site;
- index.cns - search index itself.
- docs.cns - list of all texts of the site;
- fulltxt.cns - fulltext index;
- stats.log - statistics report (for saving the indexing results in the database; see Statistics).
Note: At the present moment two types of indexing are available in the system:
- HTTP-mode - standard method of indexing a site located on a web-server. To run HTTP-indexing one should specify the site URL in the search.conf (see search.conf).
- Local disk indexing - additional variant for indexing a copy of the site stored at the local disk of your computer. Access to the Internet is not required. To run local indexinf one should specify the site URL and its files extensions (see search.conf).
There is a possibility to optimize the search process by means of the index defragmentation: the indexing results are being systematized, which allows accelerating the next search process. To fulfill defragmentation one should copy idefrag.exe file, located in the indexer directory, to a folder containing index files (index.cns, docs.cns and files.cns) and launch it. After the end of the process docs.cns will be replaced by results.cns.
To perform search within the generated index, one should perform the following options:
- Copy index files (see Indexing) to the directory containing search module; as a rule, it is /cgi-bin/ directory of the web-server;
- Define a path to search.exe file;
- Enter a search request in the form and press Search; provided that the search request has been correctly specified, the system will display the list of search results:
Figure 3 Search results
It is possible to sort out the search results by date or by relevancy.
One can set the interface of the results form with the help of templates (see Templates setting).
'fulltxt.cns' file contains all texts of the indexing documents: these data allow showing text samples, containing highlighted search phrase in the search results, for instance:
Note: 'fulltxt.cns' file may be of a considerable size; in this case one can delete it or cancel its generation by means of Type parameter (see search.conf) during the indexing process - search results will be displayed in the following way (without highlighting and citing, only first 256 symbols of a document):
Back | Manual index | Next