?? howto.swish-e
字號:
Using HarvestMan with swish-e-----------------------------HarvestMan can be used as an external crawler program for swish-e indexer {http://www.swish-e.org}. The swish-e support for HarvestMan is built into the swish-e plugin present in the pluginsfolder.Swish-e configuration---------------------In order to use swish-e with HarvestMan, an appropriate configurationfile needs to be generated. A sample configuration file is availablein this folder as swish-config.conf. Typically this configurationfile only contains two directivesIndexDir <program>SwishProgParameters <params>"IndexDir" is the path to the external crawler program. If HarvestManis installed in your machine, this would be "harvesttman". If thePATH where HarvestMan is present is not part of the PATH environmentvariable, you need to specify the full path."SwishProgParameters" is the parameters required for the externalprogram. Here you can specify the parameters required for HarvestMan.HarvestMan configuration for swish-e------------------------------------In HarvestMan, there are two ways to load plugins like swish-e.Either the plugin can be given as a command-line parameter using the-g/--plugins option, or it can be specified in the configuration fileby editing the "plugins" element and adding an appopriate pluginelement with its "enable" attribute set to 1. For more informationread the HOWTO.plugins document in the "doc" folder.There are also two ways to pass URL and other options. The suggestedway is to create an appropriate configuration file and put all theoptions there. If the file is the default 'config.xml' present inthe current directory or the user's .harvestman directory, there isno need to specify this file. In such case, "SwishProgParameters"is empty and should not be specified. In this case the swish configurationfile will look like,IndexDir harvestmanHowever, if the configuration file name is different, it has to be passed to HarvestMan with the -C option. In order to enable swish-e,the "enable" attribute of the swish-e plugin element should be set to1 in this file. In this case the swish configuration file will look like,IndexDir harvestmanSwishProgParameters -C <path_to_config_file>The other way is to specify a URL and other options in the command lineand pass it to HarvestMan. This typically can be used for the simplestcrawl which do not require a lot of customization. For example,IndexDir harvestmanSwishProgParameters -g swish-e http://swish-e.org/docs/The last line instructs HarvestMan to crawl http://www.swish-e.org/docs .Swish-e will in turn index the content of files contained at ths URL.NOTE: If you have more than three parameters to customize it is better touse a configuration file than specifying them on the command line.Running directly from source----------------------------In case you prefer to run HarvestMan directly from the source treewith swish-e without installing it, the above mentioned configurationwould not work.In this case there are two ways of writing the configuration. The simplestway is to make the harvestman.py module executable and use thefollowing configuration.IndexDir <path>/harvestman.pySwishProgParameters <params>where <path> is the relative path to where HarvestMan source code ispresent. If it is the current directory, this would be '.'.The second way is to run harvestman.py as an argument to Python. Inthis case the following configuration need to be used.IndexDir pythonSwishProgParameters <path>/harvestman.py <params>In this case, the main program becomes Python and path to harvestman.pyis passed as the first part of SwishProgParameters param value.Running swish-e ---------------Once the appropriate swish configuration file is written, swish-e canbe run with HarvestMan as followsswish-e -c <path_to_config_file> -S progOnce crawling and indexing starts, swish-e prints an output like,$ swish-e -c swish-config.cong -S progIndexing Data Source: "External-Program"Indexing "harvestman"External Program found: /usr/bin/harvestmanIf everything goes well, the indexing will terminate soon afterthe crawling is completed and an index summary is printed.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -