Pod::POM::Web::Indexer - fulltext search for Pod::POM::Web
perl -MPod::POM::Web::Indexer -e index
Adds fulltext search capabilities to the Pod::POM::Web application. This requires Search::Indexer to be installed.
Queries may include plain terms, "exact phrases", '+' or '-' prefixes, boolean operators and parentheses. See Search::QueryParser for details.
Pod::POM::Web::Indexer->new->index(%options)
Walks through directories in @INC and indexes all *.pm and *.pod files, skipping shadowed files (files for which a similar loading path was already found in previous @INC directories), and skipping files that are too big.
@INC
*.pm
*.pod
Default indexing is incremental : files whose modification time has not changed since the last indexing operation will not be indexed again.
Options can be
Size limit (in bytes) above which files will not be indexed. The default value is 300K. Files of size above this limit are usually not worth indexing because they only contain big configuration tables (like for example Module::CoreList or Unicode::Charname).
Module::CoreList
Unicode::Charname
If true, the previous index is deleted, so all files will be freshly indexed. If false (the default), indexation is incremental, i.e. files whose modification time has not changed will not be re-indexed.
If true, the indexer will also store word positions in documents, so that it can later answer to "exact phrase" queries.
So if -positions are on, a search for "more than one way" will only return documents which contain that exact sequence of contiguous words; whereas if -positions are off, the query is equivalent to more AND than AND one AND way, i.e. it returns all documents which contain these words anywhere and in any order.
-positions
"more than one way"
more AND than AND one AND way
The option is off by default, because it requires much more disk space, and does not seem to be very relevant for searching Perl documentation.
The index function is exported into the main:: namespace if perl is called with the -e flag, so that you can write
index
main::
-e
On my machine, indexing a module takes an average of 0.2 seconds, except for some long and complex sources (this is why sources above 300K are ignored by default, see options above). Here are the worst figures (in seconds) :
Date/Manip 39.655 DBI 30.73 Pod/perlfunc 29.502 Module/CoreList 27.287 CGI 16.922 Config 13.445 CPAN 12.598 Pod/perlapi 10.906 CGI/FormBuilder 8.592 Win32/TieRegistry 7.338 Spreadsheet/WriteExcel 7.132 Pod/perldiag 5.771 Parse/RecDescent 5.405 Bit/Vector 4.768
The index will be stored in an index subdirectory under the module installation directory. The total index size should be around 10MB if -positions are off, and between 30MB and 50MB if -positions are on, depending on how many modules are installed.
- highlights in shown documents - paging
To install Pod::POM::Web, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::POM::Web
CPAN shell
perl -MCPAN -e shell install Pod::POM::Web
For more information on module installation, please visit the detailed CPAN module installation guide.