File: udm-set-agent-param.xml

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (321 lines) | stat: -rw-r--r-- 13,040 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.udm-set-agent-param">
 <refnamediv>
  <refname>udm_set_agent_param</refname>
  <refpurpose>Set mnoGoSearch agent session parameters</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>udm_set_agent_param</methodname>
   <methodparam><type>resource</type><parameter>agent</parameter></methodparam>
   <methodparam><type>int</type><parameter>var</parameter></methodparam>
   <methodparam><type>string</type><parameter>val</parameter></methodparam>
  </methodsynopsis>
  <para>
   Defines mnoGoSearch session parameters.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>agent</parameter></term>
     <listitem>
      <para>
       A link to Agent, received after call to
       <function>udm_alloc_agent</function>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>var</parameter></term>
     <listitem>
      <para>
       The following parameters and their values are available:
       <itemizedlist>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_PAGE_NUM</constant> - used to choose search results page number (results
          are returned by pages beginning from 0, with <constant>UDM_PARAM_PAGE_SIZE</constant> results per page).
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_PAGE_SIZE</constant> - number of search results displayed on one page.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_SEARCH_MODE</constant> - search mode. The following values available: <constant>UDM_MODE_ALL</constant> -
          search for all words; <constant>UDM_MODE_ANY</constant> - search for any word; <constant>UDM_MODE_PHRASE</constant> -
          phrase search; <constant>UDM_MODE_BOOL</constant> - boolean search. See <function>udm_find</function>
          for details on boolean search.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_CACHE_MODE</constant> - turns on or off search result cache mode.
          When enabled, the search engine will store
          search results to disk. In case a similar search is performed later,
          the engine will take results from the cache for faster performance.
          Available values: <constant>UDM_CACHE_ENABLED</constant>,
          <constant>UDM_CACHE_DISABLED</constant>.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_TRACK_MODE</constant> - turns on or off trackquery mode. Since
          version 3.1.2 mnoGoSearch has a query tracking support.
          Note that tracking is implemented in SQL version only and not available
           in built-in database.
          To use tracking, you have to create tables for tracking support.
          For MySQL, use <filename>create/mysql/track.txt</filename>.
          When doing a search, front-end uses those tables to store query words,
          a number of found documents and current Unix timestamp in seconds.
          Available values: <constant>UDM_TRACK_ENABLED</constant>,
          <constant>UDM_TRACK_DISABLED</constant>.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_PHRASE_MODE</constant> - defines whether index database using phrases
          ("phrase" parameter in indexer.conf).
          Possible values: <constant>UDM_PHRASE_ENABLED</constant> and <constant>UDM_PHRASE_DISABLED</constant>.
          Please note, that if phrase search is enabled (<constant>UDM_PHRASE_ENABLED</constant>),
          it is still possible to do search in any mode (<literal>ANY</literal>, <literal>ALL</literal>,
          <literal>BOOL</literal> or <literal>PHRASE</literal>).
          In 3.1.10 version of mnoGoSearch phrase search is supported only in sql
          and built-in database modes,
          while beginning with 3.1.11 phrases are supported in cachemode as well.
         </simpara>
         <simpara>
          Examples of phrase search:
         </simpara>
         <simpara>
          <literal>"Arizona desert"</literal> - This query returns all indexed documents that contain
          "Arizona desert" as a phrase. Notice that you need to put double quotes
          around the phrase
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_CHARSET</constant> - defines local charset. Available values: set of
          charsets supported by mnoGoSearch, e.g. koi8-r, cp1251, ...
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_STOPFILE</constant> - Defines name and path
          to stopwords file.  (There is a small difference with mnoGoSearch
          - while in mnoGoSearch if relative path or no path entered, it
          looks for this file in relation to <constant>UDM_CONF_DIR</constant>, the module looks for
          the file in relation to current path, i.e. to the path where the
          PHP script is executed.)
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_STOPTABLE</constant> - Load stop words from the given SQL table. You may use
          several StopwordTable commands.
          This command has no effect when compiled without SQL database support.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_WEIGHT_FACTOR</constant> - represents weight factors for specific document parts.
          Currently body, title, keywords, description, url are supported.
          To activate this feature please use degrees of 2 in *Weight commands of
          the <filename>indexer.conf</filename>. Let's imagine that we have these weights:
         </simpara>
         <literallayout>
      URLWeight     1
      BodyWeight    2
      TitleWeight   4
      KeywordWeight 8
      DescWeight    16
         </literallayout>
     
         <simpara>
          As far as indexer uses bit OR operation for word weights when some
          word presents several time in the same document, it is possible at search
          time to detect word appearance in different document parts. Word which
          appears only in the body will have 00000010 aggregate weight (in binary notation).
          Word used in all document parts will have 00011111 aggregate weight.
         </simpara>
     
         <simpara>
          This parameter's value is a string of hex digits <literal>ABCDE</literal>. Each digit is a
          factor for corresponding bit in word weight. For the given above weights
          configuration:
         </simpara>
         <literallayout>
       E is a factor for weight 1  (URL Weight bit)
       D is a factor for weight 2  (BodyWeight bit)
       C is a factor for weight 4  (TitleWeight bit)
       B is a factor for weight 8  (KeywordWeight bit)
       A is a factor for weight 16 (DescWeight bit)
         </literallayout>
         <simpara>
          Examples:
         </simpara>
         <simpara>
          <constant>UDM_PARAM_WEIGHT_FACTOR</constant>=00001 will search through URLs only.
         </simpara>
         <simpara>
          <constant>UDM_PARAM_WEIGHT_FACTOR</constant>=00100 will search through Titles only.
         </simpara>
         <simpara>
          <constant>UDM_PARAM_WEIGHT_FACTOR</constant>=11100 will search through Title,Keywords,Description
          but not through URL and Body.
         </simpara>
         <simpara>
          <constant>UDM_PARAM_WEIGHT_FACTOR</constant>=F9421 will search through:
         </simpara>
         <literallayout>
        Description with factor 15  (F hex)
        Keywords with factor 9
        Title with factor  4
        Body with factor 2
        URL with factor 1
         </literallayout>
         <simpara>
          If <constant>UDM_PARAM_WEIGHT_FACTOR</constant> variable is omitted, original weight value is
          taken to sort results. For a given above weight configuration it means
          that document description has a most big weight 16.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_WORD_MATCH</constant> - word match. You may use this parameter to choose
          word match type. This feature works only in "single" and "multi" modes
          using SQL based and built-in database. It does not work in cachemode and other modes
          since they use word CRC and do not support substring search. Available values:
         </simpara>
         <simpara><constant>UDM_MATCH_BEGIN</constant> - word beginning match;</simpara>
         <simpara><constant>UDM_MATCH_END</constant> - word ending match;</simpara>
         <simpara><constant>UDM_MATCH_WORD</constant> - whole word match;</simpara>
         <simpara><constant>UDM_MATCH_SUBSTR</constant> - word substring match.</simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_MIN_WORD_LEN</constant> - defines minimal word length.
          Any word shorter this limit is considered to be a stopword. Please note
          that this parameter value is inclusive, i.e. if <constant>UDM_PARAM_MIN_WORD_LEN</constant>=3,
          a word 3 characters long will not be considered a stopword, while
          a word 2 characters long will be. Default value is 1.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_ISPELL_PREFIXES</constant> - Possible values: <constant>UDM_PREFIXES_ENABLED</constant> and
          <constant>UDM_PREFIXES_DISABLED</constant>, that respectively enable or disable using prefixes.
          E.g. if a word "tested" is in search query, also words like "test",
          "testing", etc. Only suffixes are supported by default. Prefixes usually
          change word meanings, for example if somebody is searching for the word "tested"
          one hardly wants "untested"  to be found. Prefixes support may also be
          found useful for site's spelling checking purposes. In order to enable
          ispell, you have to load ispell data with <function>udm_load_ispell_data</function>.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_CROSS_WORDS</constant> - enables or disables crosswords support.
          Possible values: <constant>UDM_CROSS_WORDS_ENABLED</constant> and <constant>UDM_CROSS_WORDS_DISABLED</constant>.
         </simpara>
         <simpara>
          The crosswords feature allows to assign words between &lt;a href="xxx"&gt; and &lt;/a&gt;
          also to a document this link leads to. It works in SQL database mode and
          is not supported in built-in database and Cachemode.
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>UDM_PARAM_VARDIR</constant> - specifies a custom path to directory where indexer
          stores data when using built-in database and in cache mode.
          By default <literal>/var</literal> directory of
          <application>mnoGoSearch</application> installation is used. Can have
          only string values.
         </simpara>
        </listitem>
       </itemizedlist>
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>val</parameter></term>
     <listitem>
      <para>
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <para>
   <informaltable>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>&Version;</entry>
       <entry>&Description;</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry>4.1.0</entry>
       <entry>
        <constant>UDM_PARAM_VARDIR</constant> was added.
       </entry>
      </row>
     </tbody>
    </tgroup>
   </informaltable>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>

 <refsect1 role="notes">
  &reftitle.notes;
  <note>
   <simpara>
    Crosswords are supported only in <application>mnoGoSearch</application> 3.1.11 or later.
   </simpara>
  </note>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->