Administration
  Home arrow Administration arrow Page 8 - Site Search with HTDIG
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ADMINISTRATION

Site Search with HTDIG
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 20
    2004-04-12


    Table of Contents:
  • Site Search with HTDIG
  • Digging Deep
  • Source Control
  • Script Barf
  • Variable Control
  • A Well-Formed Plan
  • What You See
  • Custom Job
  • Out With The Old
  • Caveat Emptor
  • Ending The Dig

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Site Search with HTDIG - Custom Job
    ( Page 8 of 11 )

    ht://Dig allows you to customize both the search form, and the result page generated from a query. In order to demonstrate, I'll create a plain-vanilla search form, called "search.html", which looks like this:

     
    <form method="post" action="/cgi-bin/htsearch">
    <
    input type="text" name="words" size="15">
    <
    input type="submit" value="Begin Search">
    </
    form

    There are a couple of important things to note here. The first is the
    ACTION attribute of the <FORM> element, which must point to the "htsearch" utility located in the Web server's CGI directory - you'll remember that this location was specified when configuring the software.

     
    <form method="post" action="/cgi-bin/htsearch"
    ... 
    </form

    The second is the search box itself - note that this element must be named "words", so that the "htsearch" utility knows to use the data within it as the search string.

     
    <input type="text" name="words" size="15"

    A number of other variables may also be set in this form to control the
    behavior of "htsearch" - here's a brief list:

    VARIABLE

    WHAT IT MEANS

    config

    sets the name of the configuration file to use

    matchesperpage

    sets number of records per result page

    method

    sets type of search (any word, all words, Boolean)

    exclude

    if set, excludes URLs matching this pattern from the result
    set

    restrict

    if set, includes only those URLs matching this pattern in
    the result set

    sort

    sorting method for result set

    Controlled Behavior

    Here's an example:

     
    <form method="post" action="/cgi-bin/htsearch">
    <
    input type="text" name="words" size="15">
    <
    input type="hidden" name="format" value="builtin-long">
    <
    input type="hidden" name="matchesperpage" value="25">
    <
    input type="hidden" name="method" value="and">
    <
    input type="hidden" name="sort" value="score">
    <
    input type="submit" value="Begin Search">
    </
    form

    More information on what these variables mean can be found in the ht://Dig documentation, at http://www.htdig.org/. For a working example, refer to the sample form installed by the software (as discussed on the previous page).



     
     
    >>> More Administration Articles          >>> More By icarus, (c) Melonfire
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek