readme.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. This directory contains some example how to create a searchable website.
  2. The docindexer program can be used to create the index.
  3. The httpsearch program is a HTTP server program that can search in the index.
  4. Both programs use an ini file that tells them what database must be used to
  5. store/consult the index.
  6. The docindexer essentially works as
  7. docindexer -c sample.ini -d /the/directory/to/index
  8. The httpsearch program can be compiled and started as a standalone HTTP server
  9. (no command-line args needed)
  10. or can be compiled as a .cgi program. See the project source, the usecgi
  11. define can be enabled/disabled to switch between the behaviour.
  12. The programs support 4 database types:
  13. PostGres
  14. Firebird
  15. SQLite
  16. File
  17. Which ones are compiled-in depend on some defines in the httpsearcher.pp file
  18. The HTTP server supports 2 kinds of queries:
  19. [baseURL]/search : search pages matching the search term.
  20. [baseURL]/list : search words matching the search term. Can be used for typeahead funcionnality
  21. [baseURL] is the base URL where the HTTP service is listening...
  22. Responses are in JSON dataset format (see extjsdataset unit)
  23. The following HTTP Request query parameters are understood for "search":
  24. q - search term. Required.
  25. m - include metadata in response
  26. r - minimum rank for response (integer>0)
  27. c - Use "contains" to search. the default is exact match (boolean: 0,1)
  28. The following HTTP Request query parameters are understood for "list":
  29. q - search term. Required unless type=all.
  30. m - include metadata in response
  31. t - Query type. One of
  32. all
  33. exact
  34. contains
  35. startswith
  36. Determines how to search words. in case t=all, q must be empty.
  37. s - Return a simple array list.
  38. The sample.ini file can contain some default configuration settings.
  39. Defaults are shown
  40. [search]
  41. ; Format the returned JSON (boolean)
  42. formatjson=0
  43. ; Default for minimum rank in search results (integer)
  44. minrank=1
  45. ; Default for returning metadata (boolean)
  46. metadata=1
  47. ; Set a CORS header on the response or not (boolean)
  48. allowcors=1