| 1 |
<html> |
|---|
| 2 |
<head> |
|---|
| 3 |
<title>SwishCtl - SWISH-E ActiveX API</title> |
|---|
| 4 |
<link href="./style.css" rel=stylesheet type="text/css" title="refstyle"> |
|---|
| 5 |
</head> |
|---|
| 6 |
<body> |
|---|
| 7 |
|
|---|
| 8 |
<h1 class="banner">SwishCtl - SWISH-E ActiveX API</h1> |
|---|
| 9 |
|
|---|
| 10 |
<dl> |
|---|
| 11 |
|
|---|
| 12 |
<dt><strong><a name="init">void swishctl.Init(str regkey)</a></strong></dt> |
|---|
| 13 |
<dd> |
|---|
| 14 |
<code>swishctl.Init("IndexFiles")</code> |
|---|
| 15 |
<p> |
|---|
| 16 |
<code>regkey</code> specifies a string value under the |
|---|
| 17 |
"HKLM\Software\SWISH-E Team\SwishCtl\Options" key |
|---|
| 18 |
which is a space separated list of filenames. |
|---|
| 19 |
Example: "IndexFiles" = "docs.idx help.idx" |
|---|
| 20 |
</p> |
|---|
| 21 |
<p> |
|---|
| 22 |
<code>regkey</code> is relative to the directory specified in |
|---|
| 23 |
"HKLM\Software\SWISH-E Team\SwishCtl\Options\IndexLocation" |
|---|
| 24 |
string value. |
|---|
| 25 |
Example: "IndexLocation" = "c:\swishctl\" |
|---|
| 26 |
</p> |
|---|
| 27 |
</dd> |
|---|
| 28 |
|
|---|
| 29 |
<dt><strong><a name="newsearch">var swishctl.NewSearch( str query )</a></strong></dt> |
|---|
| 30 |
<dd> |
|---|
| 31 |
<code>var res = swishctl.NewSearch( "test" )</code> |
|---|
| 32 |
<p> |
|---|
| 33 |
<code>query</code> is equivalent to swish-e's -w command line option. |
|---|
| 34 |
It is the full text of your query. It can be changed |
|---|
| 35 |
later through swishctl.Execute. |
|---|
| 36 |
</p> |
|---|
| 37 |
</dd> |
|---|
| 38 |
|
|---|
| 39 |
<dt><strong><a name="setsort">void swishctl.SetSort( str sort )</a></strong></dt> |
|---|
| 40 |
<dd> |
|---|
| 41 |
<code>swishctl.SetSort("swishdocpath")</code><br /> |
|---|
| 42 |
<code>swishctl.SetSort("asc swishdocpath")</code><br /> |
|---|
| 43 |
<code>swishctl.SetSort("desc swishdocpath")</code> |
|---|
| 44 |
<p> |
|---|
| 45 |
<code>sort</code> order of search results. The string is a space |
|---|
| 46 |
separated list of valid document properties. Each property |
|---|
| 47 |
may contain a qualifier that sets the direction of the sort. |
|---|
| 48 |
</p> |
|---|
| 49 |
</dd> |
|---|
| 50 |
|
|---|
| 51 |
<dt><strong><a name="error">str swishctl.Error()</a></strong></dt> |
|---|
| 52 |
<dd> |
|---|
| 53 |
<code>alert( swishctl.Error() )</code> |
|---|
| 54 |
<p> |
|---|
| 55 |
returns the text of the last SWISH-E error that occured; returns 0 if no errors. |
|---|
| 56 |
</p> |
|---|
| 57 |
</dd> |
|---|
| 58 |
|
|---|
| 59 |
<dt><strong><a name="setsearchlimit">void swishctl.SetSearchLimit( str property, str low, str high )</a></strong></dt> |
|---|
| 60 |
<dd> |
|---|
| 61 |
<code>swishctl.SetSearchLimit( "year", startyr, stopyr )</code> |
|---|
| 62 |
<p> |
|---|
| 63 |
Sets a range from <code>low</code> to <code>high</code> inclusive that the given |
|---|
| 64 |
<code>property</code> must be in to be selected as a result. |
|---|
| 65 |
Call multiple times to set more than one limit |
|---|
| 66 |
on different properties. Limits are ANDed, that is, a |
|---|
| 67 |
result must be within the range of all limits specified |
|---|
| 68 |
to be included in a list of results. |
|---|
| 69 |
</p> |
|---|
| 70 |
</dd> |
|---|
| 71 |
|
|---|
| 72 |
<dt><strong><a name="execute">void swishctl.Execute( str query )</a></strong></dt> |
|---|
| 73 |
<dd> |
|---|
| 74 |
<code>swishctl.Execute( "some words" )</code> |
|---|
| 75 |
<p> |
|---|
| 76 |
Executes a query based on the parameters in the |
|---|
| 77 |
search object.<code>query</code> is an optional query string |
|---|
| 78 |
to use for the search (<code>query</code> replaces the set query |
|---|
| 79 |
string in the search object). |
|---|
| 80 |
</p> |
|---|
| 81 |
</dd> |
|---|
| 82 |
|
|---|
| 83 |
<dt><strong><a name="hits">int swishctl.Hits()</a></strong></dt> |
|---|
| 84 |
<dd> |
|---|
| 85 |
<p> |
|---|
| 86 |
Returns the number of results for the query. If zero and no |
|---|
| 87 |
errors were reported after calling swishctl.Execute then |
|---|
| 88 |
the query returned zero results. |
|---|
| 89 |
<p> |
|---|
| 90 |
</dd> |
|---|
| 91 |
|
|---|
| 92 |
<dt><strong><a name="seekresult">void swishctl.SeekResult( int position )</a></strong></dt> |
|---|
| 93 |
<dd> |
|---|
| 94 |
<code>swishctl.SeekResult( startresult - 1 )</code> |
|---|
| 95 |
<p> |
|---|
| 96 |
Seeks to the <code>position</code> specified in the result |
|---|
| 97 |
list. Zero is the first position and swishctl.Hits-1 |
|---|
| 98 |
is the last position. Seeking past the end of results sets |
|---|
| 99 |
a non-critical error condition. |
|---|
| 100 |
</p> |
|---|
| 101 |
</dd> |
|---|
| 102 |
|
|---|
| 103 |
<dt><strong><a name="nextresult">int swishctl.NextResult()</strong></dt> |
|---|
| 104 |
<dd> |
|---|
| 105 |
<p> |
|---|
| 106 |
Fetches the next result from the list of results. Returns 0 if no more results are available. |
|---|
| 107 |
</p> |
|---|
| 108 |
</dd> |
|---|
| 109 |
|
|---|
| 110 |
<dt><strong><a name="resultpropertystring">str swishctl.ResultPropertyString( str property )</a></strong></dt> |
|---|
| 111 |
<dd> |
|---|
| 112 |
<code>swishctl.ResultPropertyString( "swishdocpath" )</code> |
|---|
| 113 |
<p> |
|---|
| 114 |
Fetches the <code>property</code> specified for the current result. |
|---|
| 115 |
</p> |
|---|
| 116 |
</dd> |
|---|
| 117 |
|
|---|
| 118 |
</dl> |
|---|
| 119 |
|
|---|
| 120 |
<div class="footer"> |
|---|
| 121 |
<br />SwishCtl is distributed with <b>no warranty</b> under the terms of the |
|---|
| 122 |
<a HREF="http://www.fsf.org/copyleft/gpl.html">GNU Public License</a>,<br /> |
|---|
| 123 |
|
|---|
| 124 |
Free Software Foundation, Inc., |
|---|
| 125 |
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA<br> |
|---|
| 126 |
Public questions may be posted to |
|---|
| 127 |
the <a HREF="http://swish-e.org/Discussion/">SWISH-E Discussion</a>. |
|---|
| 128 |
</div> |
|---|
| 129 |
|
|---|
| 130 |
</body> |
|---|
| 131 |
</html> |
|---|