· 8 years ago · Apr 24, 2018, 02:26 AM
1Quick Install:
2
3 0. Untar the distribution into your websites tree. It will create a dgssearch
4 directory. Several examples follow:
5
6 For .tar.gz files:
7 tar xvzf dgssearch-0.9.6.1.tar.gz
8 -or-
9 zcat dgssearch-0.9.6.1.tar.gz | tar xvf -
10
11 For .tar.bz2 files:
12 tar xvIf dgssearch-0.9.6.1.tar.bz2
13 -or-
14 tar xvf dgssearch-0.9.6.1.tar.bz2 --with-compress-program=bzip2
15 -or-
16 bzcat dgssearch-0.9.6.1.tar.bz2 | tar xvf -
17
18 For .zip files:
19 pkunzip -x dgssearch-0.9.6.1.zip
20 -or-
21 Use WinZip or other GUI zip program.
22
23 1. Open and configure config.php as needed (in the config directory).
24 Most options are described to the right of the option.
25
26 The options that need to be changed to use only the filesystem search are:
27
28 $config["installBase"] /* Where the package was installed. */
29 $config["fileSeparator"] /* File separator for your OS. Is "\\" on Windows. */
30 $config["urlBase"] /* The base URL for your site. */
31 $config["siteBase"] /* The directory that corresponds to the URL base. */
32 $config["fsBase"] /* Where we should begin searching the filesystem. */
33 $config["cacheFile"] /* The full path to the cache file. */
34
35 NOTE: If you are using a Windows platform, please make sure you are
36 using two backslashes in all paths (ie: c:\\inetpub\\wwwroot).
37
38 If you will also be using the database search, make sure to add "db" to the
39 $config["searchModules"]. The example below has both the "fs" and "db" search
40 modules enabled.
41
42 $config["searchModules"] = array("fs", "db");
43
44 See the documentation on $database[x] further down in this document for more
45 information on how to use the database search.
46
47 2. Test your install. Use the included index.php file as a quick test.
48
49 NOTE: If you have SAFE MODE enabled, you will need to make sure the files
50 that DGS Search will be reading are owned by the user that your web
51 server is running as. For more information on SAFE MODE, see the
52 PHP documentation.
53
54 NOTE: If DGS Search is gives the error 'Error: Must specify a query.',
55 verify in php.ini that the option 'register_globals = On'.
56
57Configuration:
58
59 config.php - This file contains all configuration options for DGS Search.
60
61 Below is a full list of options and descriptions of how they work:
62
63 General Options
64 ---------------
65
66 $config["installBase"] - Datatype: (String) - Ex: "/usr/local/apache/htdocs/dgssearch"
67
68 The directory that DGS Search was installed into.
69
70
71 $config["searchModules"] - Datatype: (Array of String) - Ex: array("fs", "db");
72
73 The modules to use for your searches. Currently the "fs" and "db" modules are
74 included with the distribution. Feel free to write additional modules.
75
76 Modules will be called in the same order they appear within the modules array.
77
78 Search modules are nothing more than a php source file in the 'libs/search'
79 directory containing a function of the same name. See MODULES for more
80 information on modules.
81
82 Search module "fs" handles filesystem searches.
83
84 Search module "db" handles database searches. See the documentation on
85 $database[x] further down on how to use the database search.
86
87
88 $config["displayModules"] - Datatype: (Array of String) - Ex: array("nav", "results");
89
90 The modules to display search results. Currently the display modules included with
91 the distribution are: title, query, stats, hr, nav, results
92
93 Feel free to write additional modules.
94
95 Modules will be called in the same order they appear within the modules array.
96 Modules can be called more than once. For example "nav" is called twice in the
97 supplied config.php.
98
99 Display modules are nothing more than a php source file in the 'libs/display'
100 directory containing a function of the same name. See MODULES for more
101 information on modules.
102
103 Display module "title" adds the title to the display results page. The title used can
104 be changed using the $config["displayHeader"] option in config.php. If you remove
105 "title" from the $config["displayModules"] array it will no longer be displayed.
106
107 Display module "query" adds a query field to the display results page. If you remove
108 "query" from the $config["displayModules"] array it will no longer be displayed.
109
110 Display module "stats" adds a statistics on the search being performed to the display
111 results page. If you remove "stats" from the $config["displayModules"] array it will
112 no longer be displayed.
113
114 Display module "hr" adds a horizontal line to the display results page. If you remove
115 "hr" from the $config["displayModules"] array it will no longer be displayed.
116
117 Display module "nav" adds result navigation to the display results page. This allows
118 you to page through groups of results. If you remove "nav" from the
119 $config["displayModules"] array it will no longer be displayed.
120
121 Display module "results" adds the results themselves to the display results page. If
122 you remove "results" from the $config["displayModules"] array it will no longer be
123 displayed. Generally this module will always be used or will be replace to display
124 search results in a different way. For example, if you were searching a catalog
125 database, you may want to create a new module to display the results similar to a
126 shopping cart.
127
128
129 $config["language"] - Datatype: (String) - Ex: "english"
130
131 The language pack DGS Search will use on the query and results page.
132
133 There is currently support for the following languages:
134
135 English
136 German
137 Spanish
138
139 To add support for an additional language, use "english.php" in the
140 "dgssearch/libs/language" directory as a template. Simply copy the template
141 to "yourlanguage.php" where "yourlanguage" is the name of your language and
142 translate. Variables within the strings take the form of @VARIABLE@. They are
143 replaced automatically by the display modules.
144
145 If you translate a new language or make a correction within an existing one,
146 please email a copy of the language file to search@digitalgenesis.com. We will
147 include new languages in future releases.
148
149
150 $config["fileSeparator"] - Datatype: (String) - Ex: "/"
151
152 The separator used in your filesystem. UNIX based systems use '/'.
153 DOS/Win based systems use '\\'. Must be '\\' since '\' is the escape character.
154
155
156 $config["header"] - Datatype: (String) - Ex: "config/header.php"
157
158 The file that is used for the header on the results page.
159
160
161 $config["footer"] - Datatype: (String) - Ex: "config/footer.php"
162
163 The file that is used for the footer on the results page.
164
165
166 $config["target"] - Datatype: (String) - Ex: "_self"
167
168 The target refers to the target frame for links. If you are not using
169 frame sets, "_self" is correct. If you have a specific target frame,
170 specify it here.
171
172
173 $config["fonts"] - Datatype: (String) - Ex: "Arial, Sans-Serif, Helvetica"
174
175 The fonts to be used on the Display Results page.
176
177
178 $config["headerColor"] - Datatype: (String) - Ex: "666699"
179
180 This is the color used for the header or title on the Display Results
181 page. This can be any valid HTML color, either keywords like "blue" or
182 RGB values like "666699".
183
184
185 $config["navColor"] - Datatype: (String) - Ex: "008000"
186
187 This is the color used for the navigation sections on the Display
188 Results page. This can be any valid HTML color, either keywords like
189 "blue" or RGB values like "008000".
190
191
192 $config["infoBarColor"] - Datatype: (String) - Ex: "008000"
193
194 This is the color used for the information bar on the Display Results
195 page. This can be any valid HTML color, either keywords like "blue" or
196 RGB values like "008000".
197
198
199 $config["infoBar"] - Datatype: (Boolean) - Ex: true
200
201 If set to true, a information bar will appear below each results
202 description on the results page. You can customize the information
203 bar with the "infoBarFormat" option below.
204
205
206 $config["infoBarFormat"] - Datatype: (String) - Ex: "@URL@ @DASH-SIZE@ @SIZE2@"
207
208 The "infoBarFormat" field is used to build the information bar that appears
209 below descriptions on the results page. The following variables are
210 currently available:
211
212 @HOST@ - The links hostname. (ie: www.xyz.com)
213 @URL@ - The links hostname. (ie: www.xyz.com/index.php)
214 @FULLURL@ - The links full URL. (ie: http://www.xyz.com/index.php)
215 @DASH-URL@ - Displays a dash if @URL@, @FULLURL@ or @HOST@ contains a value.
216 @SIZE@ - The filesize in KB for filesystem matches to 0 decimals.
217 @SIZE1@ - The filesize in KB for filesystem matches to 1 decimals.
218 @SIZE2@ - The filesize in KB for filesystem matches to 2 decimals.
219 @DASH-SIZE@ - Displays a dash if @SIZE@ contains a value.
220 @LASTMOD@ - The last modification date.
221 @DASH-LASTMOD@ - Displays a dash if @LASTMOD@ contains a value.
222 @TARGET@ - The value stored in $config['target'].
223 @DASH-TARGET@ - Displays a dash if @TARGET@ contains a value.
224
225
226 $config["dateFormat"] - Datatype: (String) - Ex: "M j, Y H:i:s"
227
228 Date format string used to generate Last Modified on Display Results.
229 See the PHP documentation on the date() function for more details.
230
231
232 $config["results"] - Datatype: (Integer) - Ex: 10
233
234 The default number of results to display per page. When set to 0, all
235 results will be displayed on one page. This will be used if 'r' is not
236 specified in the call to search.php as shown in the example below:
237
238 http://www.xyz.com/dgssearch/search.php?q=keyword&r=10
239
240
241 $config["boldQuery"] - Datatype: (Boolean) - Ex: true
242
243 If set to true, the search word(s) will be bolded in the description on
244 the results page.
245
246
247 $config["timed"] - Datatype: (Boolean) - Ex: true
248
249 If set to true, the results page will include the time taken to search.
250
251
252 $config["maxSearchTime"] - Datatype: (Float) - Ex: 25
253
254 The maximum amount of time to spend searching. When the time limit
255 expires, the module will exit early reporting only the results it had
256 located so far. PHP by default will only allow a script to run for
257 30 seconds (configurable in php.ini on UNIX platforms.)
258
259 Set to 0 to disable this feature.
260
261 NOTE: Database searches can only be interrupted between searches, which
262 means it may take longer than expected to exit the "db" module.
263
264
265 $config["translate"] - Datatype: (Boolean) - Ex: true
266
267 If set to true, each result will include a link to the translation service
268 at http://babel.altavista.com. The $config["translateFrom"] option will
269 set the default translation to be done.
270
271 NOTE: Users will still need to hit the button "Translate" at that site.
272
273
274 $config["translateFrom"] - Datatype: (String) - Ex: en_de
275
276 This is the default translation to be done at http://babel.altavista.com.
277 The currently available translation options are listed below:
278
279 en_fr - English to French
280 en_de - English to German
281 en_it - English to Italian
282 en_pt - English to Portuguese
283 en_es - English to Spanish
284 fr_en - French to English
285 de_en - German to English
286 it_en - Italian to English
287 pt_en - Portuguese to English
288 es_en - Spanish to English
289 de_fr - German to French
290 fr_de - French to German
291 ru_en - Russian to English
292
293
294 $config["verifyConfig"] - Datatype: (Boolean) - Ex: true
295
296 If set to true, the config file is verified each time DGS Search is run.
297
298 This feature can be disabled for a small speed increase once your config
299 is known to be valid.
300
301 NOTE: If debug is enabled, verifyConfig will be enabled automatically.
302
303
304 $config["warn"] - Datatype: (Boolean) - Ex: true
305
306 If set to true, warnings will be displayed on the results page.
307 The most common use of this function is to allow SAFE MODE warnings
308 to be displayed, so they can be fixed. Most of these will be caused
309 by the script being owned by a different user than the files you
310 will be searching.
311
312 NOTE: If debug is enabled, warn will be enabled automatically.
313
314
315 $config["debug"] - Datatype: (Boolean) - Ex: false
316
317 If set to true, debugging information will be displayed on the results
318 page. This can often help track down configuration errors.
319
320
321 $config["remoteDebug"] - Datatype: (Boolean/String) - Ex: false
322
323 If set to true, a remote site will be able to see debugging information
324 using specialized parameters passed to search.php. This is useful on live
325 sites, since normal users won't see debugging information.
326
327 When set to true, you can use this options as follows:
328
329 http://www.xyz.com/dgssearch/search.php?q=word&debug=true
330
331 If you would like to set a password for this feature, rather than setting
332 true, set it to a string value which will act as your password. Below is
333 an example of setting a password:
334
335 $config["remoteDebug"] = "myPassword";
336
337 When a password is set, you can use this option as follows:
338
339 http://www.xyz.com/dgssearch/search.php?q=word&debug=myPassword
340
341 Generally you will want this feature disabled (set to false), as it allows
342 the remote site to collect information about your install of PHP and how
343 DGS Search is configured on your system. If you are paranoid about this
344 feature, remove the function remoteDebug() from 'dgssearch/libs/utils.php'.
345
346 When remote debug is enabled, you will be able to use its extended features.
347 Below are examples of how to use these features:
348
349 PHP Information
350
351 http://www.xyz.com/dgssearch/search.php?q=word&debug=true&option=phpinfo
352
353 DGS Search Configuration Information
354
355 http://www.xyz.com/dgssearch/search.php?q=word&debug=true&option=config
356
357 Misc Tests Information
358
359 http://www.xyz.com/dgssearch/search.php?q=word&debug=true&option=test
360
361 Ash Quote
362
363 http://www.xyz.com/dgssearch/search.php?q=word&debug=true&option=ash
364
365 All Information (All options)
366
367 http://www.xyz.com/dgssearch/search.php?q=word&debug=true&option=all
368
369
370 $config["hideCredits"] - Datatype: (Boolean) - Ex: false
371
372 If set to true, the string "DGS Search" and link to our site will be
373 removed from the bottom of the results page. We would like to ask that
374 you leave this option set to false, as makes it easy for others to
375 locate DGS Search.
376
377
378 Filesystem Options
379 ------------------
380
381 $config["urlBase"] - Datatype: (String) - Ex: "http://www.digitalgenesis.com"
382
383 The base URL for your site. The URL will be used to generate links to your
384 search results.
385
386
387 $config["siteBase"] - Datatype: (String) - Ex: "/usr/local/apache/htdocs"
388
389 The directory that corresponds to the URL base.
390
391
392 $config["fsBase"] - Datatype: (String) - Ex: "/usr/local/apache/htdocs"
393
394 The directory on your local filesystem to begin searching.
395
396
397 $config["fsExclude"] - Datatype: (Array of String) - Ex: array("^\.ht", "secret.txt")
398
399 A list of directories or files that should be excluded from your search.
400 Entries are treated as regular expressions.
401
402 This option will take precedence over $config["exts"] option. This allows
403 you to include all ".html" files, but a specific file like "secret.html".
404
405 NOTE: If an entry is not an absolute path, the entry is compared relative
406 to the directory DGS Search is currently processing. For example, if
407 you list 'images' and '\.gif$' to be excluded, any directory named
408 'images' and any file ending in ".gif" will be excluded.
409
410
411 $config["cacheFile"] - Datatype: (String) - Ex: "/tmp/dgssearch.cache"
412
413 Cache file to be used for storing the filenames that will be searched.
414 Use of a cache file speeds up filesystem searches, since DGS Search
415 won't need to scan the filesystem for ever search request. On Windows
416 platforms, this should be set to "c:\\temp\\dgssearch.cache" or
417 another temporary directory.
418
419
420 $config["cacheTTL"] - Datatype: (Integer) - Ex: 3600
421
422 The time to live (TTL) in seconds for the filesystem cache file.
423 When the cache file becomes older than the TTL, DGS Search will scan the
424 filesystem and generate a new cache file. If the TTL is set to 0, then
425 filesystem caching will be disabled.
426
427 If the HTML on your site doesn't change very often, you may want to set
428 the TTL up to 86400 (1 day) or higher to keep DGS Search from rebuilding
429 the cache file so often.
430
431
432 $config["maxFileSize"] - Datatype: (Integer) - Ex: 51200
433
434 The maximum filesize in bytes that DGS Search will search. If the file
435 is larger than the specified size, it will be skipped. This gives you
436 a way to exclude files that are not searchable in a reasonable amount
437 of time.
438
439
440 $config["metaDesc"] - Datatype: (Boolean) - Ex: false
441
442 If set to true, DGS Search will attempt to extract the META 'description'
443 from files rather than a context description. If no META tag is available
444 it will fall back to the normal context descriptions.
445
446 NOTE: This feature will slow down searches slightly. It will also truncate
447 longer descriptions down to one line.
448
449
450 $config["stripTags"] - Datatype: (Boolean) - Ex: true
451
452 If set to true, all HTML and PHP tags will be stripped from files before
453 they are searched for a query. If set to false, the actual HTML and PHP
454 code could be found and displayed in the descriptions on the Search Results
455 page, possibly exposing passwords or other sensitive information.
456
457
458 $config["followLinks"] - Datatype: (Boolean) - Ex: true
459
460 If set to true, SymLinks will be followed on systems that support SymLinks.
461 On systems that lack the is_link() function, this setting will be ignored.
462
463
464 $config["frameSet"] - Datatype: (Boolean) - Ex: false
465
466 If set to true, DGS Search will attempt to provide a link to the frame set,
467 rather than the automatically generated documents that are embedded in the
468 frame sets. If set to false, no substitutions will be made.
469
470 The schemes schemes currently supported are:
471
472 Files named 'xy-[0-9]+.html?' are replaced with 'xy.html', if it exists.
473
474 Files named 'xy/[0-9]+.html?' are replaced with 'xy/xy.html', if it exists.
475
476
477 $config["exts"] - Datatype: (Array of String) - Ex: array("html", "php3?", "txt")
478
479 A list of extensions that will determine what files in your site are
480 searched. Regular expressions can be used to include groups of
481 extensions into one entry. For example, 'html?' will include all "htm" and
482 "html" files within your searches.
483
484 The $config["fsExclude"] option will take precedence over this option. This
485 allows you to include all ".html" files, but a specific file like "secret.html".
486
487 NOTE: If this option is set to "" or undefined, then DGS Search will read all
488 files within a directory, regardless of the file extension.
489
490 NOTE: Do not place a leading dot before extensions unless you are intentionally
491 using the dot as a regular expression wildcard character.
492
493
494 $config["docExts"] - Datatype: (Array of String) - Ex: array("pdf", "doc", "ps")
495
496 A list of extensions to build a link to rather than the actual HTML or text
497 document that was searched.
498
499 This features allows you to locate results that are plain text, such as PDF,
500 Word Documents, and Postscript files.
501
502 For example, if DGS Search determines that the file 'manual.txt' matches your
503 search and there is a file named 'manual.pdf' in the same directory, the results
504 page will contain a link the file 'manual.pdf' rather than the file it searched.
505
506 DGS Search will prefer document extensions in the order they are listed within
507 'docExts' array. If 'pdf' was listed first in the array and there was a 'pdf'
508 and a 'ps' file in a directory, the 'pdf' file would be used on the results page.
509
510 NOTE: If this option is set to "" or undefined, then DGS Search will not do any
511 substitutions on the results page.
512
513 NOTE: DGS Search will not do any document conversion for you. You must generate
514 text files from your own 'pdf', 'doc', or 'ps' files. Many Linux distributions
515 include the program 'ps2ascii' which can be used to convert 'pdf' and 'ps'
516 documents into text. Another program called 'pstotext' is also available.
517
518
519 $config["descWidth"] - Datatype: (Integer) - Ex: 80
520
521 The width or string length of the description on the Search Results page.
522
523
524 $config["descHeight"] - Datatype: (Integer) - Ex: 2
525
526 The height of number of lines of description to be displayed on the Search
527 Results page.
528
529
530 $config["descEnd"] - Datatype: (String) - Ex: "..."
531
532 The string that to be added to the beginning and end of the description.
533
534
535 Database Options
536 ----------------
537
538 NOTE: The 'x' in $database[x]["keyword"] should be replace with an integer
539 value such as 0, 1, 2, etc. This allows searching of multiple databases
540 or tables within a database.
541
542 $database[x]["type"] - Datatype: (String) - Ex: "mysql"
543
544 This is the database type. This can be different on each database entry.
545 Currently supported types are: mysql, pgsql, mssql, odbc and ibase.
546
547
548 $database[x]["server"] - Datatype: (String) - Ex: "localhost"
549
550 The hostname, IP address or PIPE name of the SQL server.
551
552 NOTE: This options is ignored if $database[x]["type"] is set to 'odbc'.
553
554 NOTE: If you are connecting to a local MSSQL server, use the PIPE name,
555 localhost or 127.0.0.1 won't work. (At least on our test server.)
556 Your interface IP address will also work.
557
558 NOTE: If $database[x]["type"] is set to 'ibase', then server must be set
559 specific to the type of connection you are making to your server.
560 See the below examples:
561
562 For a TCP/IP connection to your InterBase server, "server" must
563 be set to the hostname or IP address followed by a colon, such
564 as "hostname:" or "10.1.1.10:".
565
566 For a NetBEUI connection to your InterBase server, "server" must
567 be set to a NetBEUI hostname path, such as "//hostname/".
568
569 For a IPX/SPX connection to your InterBase server, "server" must
570 be set to the IPX/SPX hostname followed by the @ symbol, such as
571 "hostname@".
572
573 For a connection to a InterBase database on the same server,
574 "server" can be set to the empty string, such as "".
575
576
577 $database[x]["port"] - Datatype: (Integer) - Ex: 3306
578
579 The TCP/UDP port to use when communicating with the server. If set to
580 0, the default port will be used. The ODBC database type will ignore
581 this option.
582
583
584 $database[x]["username"] - Datatype: (String) - Ex: "username"
585
586 The username used to connect to your database. Set to an empty string
587 if your database uses no username.
588
589
590 $database[x]["password"] - Datatype: (String) - Ex: "password"
591
592 The password used to connect to your database. Set to an empty string
593 if your database uses no password.
594
595
596 $database[x]["database"] - Datatype: (String) - Ex: "database"
597
598 The name of the database or DSN to connect to and search.
599
600
601 $database[x]["persistent"] - Datatype: (Boolean) - Ex: true
602
603 If set to true, persistent database connections will be used.
604 Non-persistent connections are slower, but may be needed for compatibility
605 with some databases. (For example, MSSQL's ODBC driver isn't able to
606 handle parallel selects on a persistent connection.)
607
608 If you begin to get SQL errors while multiple searches are being processed
609 at the same time, turn persistent connection off. It should clear up the
610 problem.
611
612
613 $database[x]["table"] - Datatype: (Array of String) - Ex: array("article", "magazine")
614
615 The name of the table(s) in your database to search. In most cases, you will only be
616 searching one table.
617
618 If more than one table is listed in the "table" array, then DGS Search will attempt to do
619 an SQL join based on $database[x]["tableAssoc"].
620
621 If you had the SQL statement:
622
623 SELECT * FROM article, magazine WHERE field = 1;
624
625 The "table" array is used to build the "article, magazine" section of that statement.
626
627
628 $database[x]["tableAssoc"] - Datatype: (String) - Ex: "article.magazineid = magazine.magazineid"
629
630 A string of rules for associating the records in multiple tables. If you
631 are only searching one table, set this value to the empty string.
632
633 If you had the SQL statement:
634
635 SELECT * FROM article, magazine WHERE article.magazineid = magazine.magazineid;
636
637 The "tableAssoc" is used to build the "article.magazineid = magazine.magazineid" section
638 of that statement.
639
640
641 $database[x]["returnField"] - Datatype: (Array of String) - Ex: array("author", "title", "mag_name", "articleid")
642
643 The fields returned from the database. These fields can be used to substitute
644 into the URL and description. The fields are referred to in the same order
645 they are listed within the array, starting from 0. The first field 'author'
646 would be referred to as '@0@'. The second field 'title' would be referred to as
647 @1@. The third field 'mag_name' would be '@2@', etc.
648
649 If you had the SQL statement:
650
651 SELECT author, title, mag_name, articleid FROM table WHERE articleid = 1;
652
653 The "returnField" array is used to build the "author, title, mag_name, articleid"
654 section of that statement. It determines what data from the database you can use to
655 build your "link", "url" and "desc" on the results page.
656
657
658 $database[x]["searchField"] - Datatype: (Array of String) - Ex: array("title")
659
660 The field(s) to search within your table. These are the fields DGS Search will search to
661 locate results.
662
663 If you had the SQL statement:
664
665 SELECT articleid, title FROM table WHERE title = "Rings";
666
667 The "searchField" array is used to build the "title = Rings" section of that statement.
668
669
670 $database[x]["link"] - Datatype: (String) - Ex: "Article name is '@1@'"
671
672 The descriptive link on the Search Results page. Variables '@0@', '@1@', etc. can
673 be used within the string to produce dynamic content. The variables refer to the
674 fields within the $database[x]["returnField] array, counting up from 0.
675
676
677 $database[x]["url"] - Datatype: (String) - Ex: "http://www.xyz.com/bogus.php?id=@3@"
678
679 The URL to your page that displayed the data from the database. Variables '@0@',
680 '@1@', etc. can be used within the string to produce a dynamic URL. The variables
681 refer to the fields within the $database[x]["returnField] array, counting up from 0.
682
683 NOTE: The file bogus.php is not included and is just an example. You must create
684 your own page to display what DGS Search finds in your database. (You would
685 not believe how many people don't get this.)
686
687
688 $database[x]["desc"] - Datatype: (Array of String) - Ex: array("@1@ was published in @2@.", "Authored by @0@.")
689
690 The description displayed below the link on the Search Results page. Each string in the
691 array will be a different line in the description. Variables '@0@', '@1@', etc. can be
692 used within the string to produce dynamic content. The variables refer to the fields
693 within the $database[x]["returnField] array, counting up from 0.
694
695
696 $database[x]["descWidth"] - Datatype: (Integer) - Ex: 80
697
698 The width or string length of the description on the Search Results page. This is set
699 on a per database basis.
700
701 Set to 0 to disable this feature.
702
703
704 $database[x]["wildcard"] - Datatype: (String) - Ex: "Both"
705
706 This setting determines how DGS Search will search your database for the
707 query. Supported options are: None, Left, Right or Both. If set to None,
708 the query will match whole words only. If set to both, then the query will
709 be treated as a substring. Left and Right will cause wildcard character to
710 be placed on the corresponding side.
711
712 For those familiar with SQL, setting None results in the following statement:
713
714 SELECT * FROM table WHERE field = 'query'
715
716 Setting Both results in the following statement (% is the wildcard character):
717
718 SELECT * FROM table WHERE field LIKE '%query%'
719
720 Setting Left results in the following statement:
721
722 SELECT * FROM table WHERE field LIKE '%query'
723
724 Setting Right results in the following statement:
725
726 SELECT * FROM table WHERE field LIKE 'query%'
727
728
729 $database[x]["orderByDepth"] - Datatype: (Integer) - Ex: 2
730
731 The order by depth sets the number of result fields to use when ordering the
732 results from the database. The default of -1, will use all result fields to
733 order the results. If set to 2, then only the first two result fields are
734 used to order the results. If you are working with a large database, this
735 setting may help you speed searches. The more fields you order by, the
736 longer a result set usually takes.
737
738
739 $database[x]["forceLower"] - Datatype: (Boolean) - Ex: false
740
741 Forces a case-insensitive search by lowercasing everything. Most databases default
742 to case-insensitive searches, so this option should generally be set to false. This
743 feature uses the SQL function LOWER() or LCASE() available with most SQL servers.
744
745
746 Constants
747 ---------
748
749 NOTE: These options generally don't need to be changed.
750
751 $config["version"] - Datatype: (String) - Ex: "v0.9.4"
752
753 The current version of DGS Search.
754
755
756 $config["maxResults"] - Datatype: (String) - Ex: 65535
757
758 The total number of results that can be displayed per page. This value is
759 used internally to allow all results to be displayed on one page, if results
760 is set to 0.
761
762
763 $config["extSeparator"] - Datatype: (String) - Ex: "."
764
765 The file extension separator used to in your filesystem.
766
767
768 $config["thisDir"] - Datatype: (String) - Ex: "."
769
770 The string used in denote the current directory.
771
772
773 $config["parentDir"] - Datatype: (String) - Ex: ".."
774
775 The string used in denote the parent directory.