| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title> |
| 5 |
ht://Dig: htsearch |
| 6 |
</title> |
| 7 |
</head> |
| 8 |
<body bgcolor="#eef7ff"> |
| 9 |
<h1> |
| 10 |
htsearch |
| 11 |
</h1> |
| 12 |
<p> |
| 13 |
ht://Dig Copyright © 1995-2004 <a href="THANKS.html">The ht://Dig Group</a><br> |
| 14 |
Please see the file <a href="COPYING">COPYING</a> for |
| 15 |
license information. |
| 16 |
</p> |
| 17 |
<hr size="4" noshade> |
| 18 |
<h2> |
| 19 |
Search Method Used |
| 20 |
</h2> |
| 21 |
<p> |
| 22 |
The way htsearch performs it search and applies its ranking |
| 23 |
rules are fairly complicated. This is an attempt at explaining |
| 24 |
in global terms what goes on when htsearch searches. |
| 25 |
</p> |
| 26 |
<p> |
| 27 |
htsearch gets a list of (case insensitive) words from the HTML |
| 28 |
form that invoked |
| 29 |
it. If htsearch was invoked with boolean expression parsing |
| 30 |
enabled, it will do a quick syntax check on the input words. |
| 31 |
If there are syntax errors, it will display the syntax error |
| 32 |
file that is specified with the |
| 33 |
<a href="attrs.html#syntax_error_file">syntax_error_file</a> |
| 34 |
attribute. |
| 35 |
</p> |
| 36 |
<p> |
| 37 |
If the boolean parser was not enabled, the list of words is |
| 38 |
converted into a boolean expression by putting either "and"s |
| 39 |
or "or"s between the words. (This depends on the search |
| 40 |
type.) Phrases within double quotes (") specify that the words |
| 41 |
must occur sequentially within the document. |
| 42 |
</p> |
| 43 |
<p> |
| 44 |
If a word is immediately preceeded by a field specifer |
| 45 |
(title:, heading:, author:, keyword:, descr:, link:, url:) |
| 46 |
then it will only match documents in which the word occurred |
| 47 |
within field. For example, descr:foo only matches documents |
| 48 |
containing <meta value="description" value="... foo ...">. |
| 49 |
The link: field refers to the text in the hyperlinks to a document, |
| 50 |
rather than text within the document itself. Similarly url: |
| 51 |
(will eventually) refer to the actual URL of the document, not any |
| 52 |
of its contents. |
| 53 |
The prefixes exact: and hidden: are also accepted. |
| 54 |
The former (will) cause the |
| 55 |
<a href="attrs.html#search_algorithm">fuzzy search algorithm</a> |
| 56 |
not to be applied to this word, while the latter causes the word |
| 57 |
not to be displayed in the query string of the results page. |
| 58 |
</p> |
| 59 |
<p> |
| 60 |
Each of the words in the list (but not within a phrase) is now |
| 61 |
expanded using the search algorithms that were specified in the |
| 62 |
<a href="attrs.html#search_algorithm">search_algorithm</a> |
| 63 |
attribute. For example, the endings algorithm will convert a |
| 64 |
word like "person" into "person or persons". In this fashion, |
| 65 |
all the specified algorithms are used on each of the words |
| 66 |
and the result is a new boolean expression. |
| 67 |
</p> |
| 68 |
<p> |
| 69 |
The next step is to perform database lookups on the words in |
| 70 |
the expression. The result of these lookups are then passed |
| 71 |
to the boolean expression parser. |
| 72 |
</p> |
| 73 |
<p> |
| 74 |
The boolean expression parser is a simple recursive descent |
| 75 |
parser with an operand stack. It knows how to deal with |
| 76 |
"not", "and", "or" and parenthesis. The result of the parser |
| 77 |
will be one set of matches.<br> |
| 78 |
Note that the operator "not" is used as the word 'without' and |
| 79 |
is binary: You can not write "cat and not dog" or just "not |
| 80 |
dog" but you can write "cat not dog". |
| 81 |
</p> |
| 82 |
<p> |
| 83 |
At this point, the matches are ranked. The rank of a match is |
| 84 |
determined by the weight of the words that caused the match |
| 85 |
and the weight of the algorithm that generated the word. Word |
| 86 |
weights are generally determined by the importance of the |
| 87 |
word in a document. For example, words in the title of a |
| 88 |
document have a much higher weight than words at the bottom |
| 89 |
of the document. |
| 90 |
</p> |
| 91 |
<p> |
| 92 |
Finally, when the document ranks have been determined and the |
| 93 |
documents sorted, the resulting matches are displayed. If |
| 94 |
paged output is required, only a subset of all the matches |
| 95 |
will be displayed. |
| 96 |
</p> |
| 97 |
<hr size="4" noshade> |
| 98 |
|
| 99 |
Last modified: $Date: 2004/05/28 13:15:18 $ |
| 100 |
|
| 101 |
</body> |
| 102 |
</html> |