1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
=======================================================================
mnoGoSearch.php frontend for mnoGoSearch ( formely known as UdmSearch)
free web search engine
=======================================================================
Please send you comments, questions and suggestions to
udmsearch@search.udm.net (Main maillist)
devel@search.udm.net (Developers maillist)
Main features are:
-----------------
* ispell support. Can load ispell data both from database
(as udmsearch 2.x does) and from plain text (as 3.x versions)
* MySQL, Oracle (both v7 and v8), PostgreSQL backend support
* both in native and ODBC modes
* "crc" and "crc-multi" storage table modes support
* Multi-dict and Single-dict storage table modes
* boolean query language support
* Nested categories support
* best documents are found first
* HTML templates to easily customize search results
* Multiple output formats for search results support
* Language content negotiation support
* Soundex support
* PHP4 compatibility
* MS Windows compatibility
Reqirements:
------------
search.php requires PHP 3.0.9 or later built with perl-compatible
regular expressions and MySQL and/or Oracle and/or PostgreSQL support.
Frontend successfully tested with PHP4 and with Microsoft Windows.
Files:
------
src/Makefile - Makefile for building some support binaries
src/crc32.c - C source code for building crc32 binary file
src/search.php - main PHP script
src/config.inc - include file for search.php with configuration part
src/common.inc - include file for search.php with common functions
src/crc32.inc - include file for search.php with crc32 functions
src/db_func.inc - include file for search.php with databases interface
src/init.inc - include file for search.php with init functions
src/ispell.inc - include file for search.php with ispell interface
src/parse.inc - include file for search.php with query parsing functions
src/template.inc - include file for search.php with template functions
sample/search.htm.mysql - template for MySQL in single mode in native mode (without ispell support)
sample/search.htm.mysql.odbc - template for MySQL in single mode in ODBC mode (without ispell support)
sample/search.htm.ora.crc - template for Oracle in "crc" mode (with ispell support in text mode)
sample/search.htm.pgsql.multi - template for Postgres in "multi-dict" mode (with ispell support in db mode)
How do I use it?
----------------
1. Copy all distribution files into one directory.
2. Edit search.php and setup $template_file='/path/to/search.htm'; // path to template file
3. Edit config.inc settings at the beginning of the script:
$db_format='3.1'; // Database Format
// Can be '3.0' (default) or '3.1',
// according to udmsearch version you are using with
$grep='/bin/grep'; // path to grep utility
$crc32='./crc32'; // paty to crc32 utility (see below)
$DEBUG=0; // set to 1 if you want to see all sql-queries sent to backent
$MAX_NP=1000; // maximum allowed results page number
$MAX_PS=100; // maximum allowed results per page
$LC_ALL='ru_RU.KOI8-R'; // (optional) define it if you with to hardcode locate settings.
$DEFAULT_QUERY_TYPE='and'; // (optional) default query type.
// Possible values : "and", "or"
// Default value - "and". This can be reassigned via search template.
$dbodbc_cursor_type=SQL_CUR_USE_IF_NEEDED; // (optional) odbc cursor type. Use if your ODBC driver fails to work.
// Possible values are: SQL_CUR_USE_IF_NEEDED, SQL_CUR_USE_ODBC,
// SQL_CUR_USE_DRIVER, SQL_CUR_DEFAULT
$trackquery='no'; // default value for TrackQuery template parameter
$rus_bool_lang='no'; // (optional) default value for russian boolean language enchance variable
$lang_content_negotiation='no'; // (optional) Enable language content negotiation
// Please refer to docs/negotiation.txt for details
$soundex = 'no'; // (optional) Enable soundex support
$lang_url_translation='no'; // (optional) Enable language url translation
// for example url "path/file.en.ext"
// will be translated into "path/file"
// Please refer to docs/negotiation.txt for details
4. Edit search.htm. Php frontend adds several additional variables to standart
template file.
DBAddr <URL-style database description>
Database options (type, host, database name, port, user and password)
to connect to SQL database.
Should be used only once and before any other commands.
Command have global effect for whole config file.
Format: DBAddr <DBType>:[//DBUser[:DBPass]@DBHost[:DBPort]]/DBName/
Please note, that if you does not specified DBHost, or if you set
it to '_socket', that connection will be established through the
local unix socket for MySQL and PostgreSQL database backends.
DBType describes your sql-frontend. Currently supported "oracle",
"oracle7", "oracle8", "mysql" and "pgsql" types. "oracle" is a
synonym for "oracle8". If you wish to use this backends in ODBC
mode you should add "-odbc" to DBType. For example to use mysql
in ODBC mode you should set DBType to "mysql-odbc".
DBMode used to set your dict table structure. For multi-dict mode you
should use DBMode multi, for "crc" mode please use DBMode crc,
for "crl-multi" mode please use DBMode crc-multi, otherwise you
should set it to "single". In ODBC mode DBName used as DSN name.
If you are using "crc" or "crc-multi" table mode, and using php
4.0.0 or earlier, you should also compile crc32 binary.
Distribution contains Makefile to do that.
Run make at command prompt to begin compilation. If success, you
should get "crc32" binary file. If you have php-4.0.1 ot later
should not compile binary because of this versions has native crc32
function.
Clones variable values can be "yes" or "no". Default is "yes".
"Yes" means that frontend should show clones of pages found.
TrackQuery variable values can be "yes" or "no". Default is "no".
"Yes" means that frontend should save all queries to qtrack table.
Hilight found word syntax.
HLBeg variable is prepended before the word. Default is <b>
HLEnd is appended after the word. Default is </b>
IspellMode activates ispell support. Can be "text","db" or "none".
Default - "none". NOTE, that before using ispell in "db" mode you
should load ispell file into database (please refer to udmsearch v2.x).
If you decided to use "text" mode you should specify additional
variables:
Affix <lang> <ispell affixes file name>
Spell <lang> <ispell dictionary filename>
The first parameter of both commands is two letters language abbrevation.
The second one is filename. File name are relative to search.php directory.
Absolute paths can be also specified.
Note that loading of several languages is supported at the same time.
For example,
Affix en en.aff
Spell en en.dict
Addix de de.aff
Spell de de.dict
will load ispell support for both English anf German languages.
Examples of variable section of template:
a) mysql/single mode (without ispell support):
<!--variables
DBAddr mysql://udm:udm@localhost/udmsearch/
DBMode single
IspellMode none
-->
b) oracle/crc mode (with ispell support in text mode):
<!--variables
DBAddr oracle://udm:udm@localhost/udmsearch/
DBMode crc
IspellMode text
Affix en /usr/local/udmsearch/ispell/en.aff
Spell en /usr/local/udmsearch/ispell/en.dict
-->
c) postgres/multidict mode (with ispell support in db mode):
<!--variables
DBAddr pgsql://udm:udm@localhost/udmsearch/
DBMode multi
IspellMode db
-->
NOTE FOR ORACLE USERS:
-----------------------
OCIPLogon function uses only DBName, DBUser and DBPass variable to
connect to the backend.
PHP says:
The DBName parameter can either contain the name of the local Oracle
instance or the name of the entry in tnsnames.ora to which you want
to connect. If the DBName is not specified, PHP uses the environment
variables ORACLE_SID (Oracle instance) or TWO_TASK (tnsnames.ora) to
determine which database to connect to.
|