# # Alexander Barkov # Maxime Zakharov # # Sample fo HTDB virtual scheme usage # # I tested this to search through our web-board # at http://search.mnogo.ru/board/board.php?board=1 # wich is stored in MySQL database. Messages # are available under URLs like this: # http://search.mnogo.ru/board/message.php?id=XXX # where XXX is message PRIMARY KEY value. # DBAddr mysql://foo:bar@localhost/search/ # Connection to base with data HTDBAddr mysql://foo:bar@localhost/web/ # List which will be gererated for "htdb:/" URL HTDBList "SELECT concat('http://search.mnogo.ru/board/message.php?id=',id) \ FROM udm.messages LIMIT 2" # Documents which will be generated for each "htdb:/XXX" documents # where XXX is 'messages' table PRIMARY KEY value. HTDBDoc "\ SELECT concat( \ 'HTTP/1.0 200 OK\\r\\n',\ 'Content-type: text/html\\r\\n',\ 'Last-Modified: ',Date_format(posted,'%a, %d %b %Y %T'),' GMT\\r\\n',\ '\\r\\n',\ '',\ '',subject,'',\ '',\ '\\n',\ '\\n',msg,'\\n'\ ) \ FROM udm.messages \ WHERE id='$1'" # Add HTDBList to generate a list of messages: Server htdb:/ # Add messages: Realm http://search.mnogo.ru/board/message.php?id=* # Add messages URL translation: # http://search.mnogo.ru/board/message.php?id=XXX -> htdb:/XXX Alias http://search.mnogo.ru/board/message.php?id= htdb:/ Include sections.conf