Documentation Source Text

Check-in [e6b9763fab]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update fts3 documentation with docs for the matchinfo 'y' flag.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e6b9763fab480e58de9d163cfbc9f647d87bd02c
User & Date: dan 2015-05-02 09:40:53
Context
2015-05-04
11:38
Add a brief document on the sqldiff.exe utility. Rewrite the mostdeployed.html document. check-in: ec5b570727 user: drh tags: trunk
2015-05-02
09:40
Update fts3 documentation with docs for the matchinfo 'y' flag. check-in: e6b9763fab user: dan tags: trunk
2015-05-01
19:49
Fix an error in the fts5 documentation for the NEAR operator. check-in: 807c985334 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/fts3.in.

1129
1130
1131
1132
1133
1134
1135




































1136
1137
1138
1139
1140
1141
1142
      etc. In other words, the data for occurrences of phrase <i>p</i> in
      column <i>c</i> may be found using the following formula:
<pre>
          hits_this_row  = array&#91;3 * (c + p*cols) + 0&#93;
          hits_all_rows  = array&#91;3 * (c + p*cols) + 1&#93;
          docs_with_hits = array&#91;3 * (c + p*cols) + 2&#93;
</pre>





































  <tr><td>n <td>1 <td>The number of rows in the FTS4 table. This value is
    only available when querying FTS4 tables, not FTS3.
  <tr><td>a <td><i>cols</i> <td>For each column, the average number of
    tokens in the text values stored in the column (considering all rows in
    the FTS4 table). This value is only available when querying FTS4 tables,
    not FTS3.  







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
      etc. In other words, the data for occurrences of phrase <i>p</i> in
      column <i>c</i> may be found using the following formula:
<pre>
          hits_this_row  = array&#91;3 * (c + p*cols) + 0&#93;
          hits_all_rows  = array&#91;3 * (c + p*cols) + 1&#93;
          docs_with_hits = array&#91;3 * (c + p*cols) + 2&#93;
</pre>
  <tr><td>y <td style="white-space:nowrap"><i>cols</i> * <i>phrases</i> 
    <td>
      For each distinct combination of a phrase and table column, the
      number of usable phrase matches that appear in the column. This is
      usually identical to the first value in each set of three returned by the
      'x' directive (see above). However, the number of hits reported by the
      'y' directive is zero for any phrase that is part of a sub-expression
      that does not match the current row. This makes a difference for
      expressions that contain AND operators that are descendants of OR
      operators. For example, consider the expression: 
<pre>
          a OR (b AND c)
</pre>
      and the document:
<pre>
          "a c d"
</pre>
      The 'x' directive would report a single hit for the phrases "a" and "c".
      However, the 'y' directive reports the number of hits for "c" as zero, as
      it is part of a sub-expression that does not match the document - (b AND c).
      For queries that do not contain AND operators descended from OR
      operators, the result values reuturned by 'y' are always the same as
      those returned by 'x'.

<p style="margin-left:0;margin-right:0">
      The first value in the array of integer values corresponds to the
      leftmost column of the table (column 0) and the first phrase in the query
      (phrase 0). The values corresponding to other column/phrase combinations
      may be located using the following formula:

<pre>
          hits_for_phrase_p_column_c  = array&#91;3 * (c + p*cols) + 0&#93;
</pre>
      For queries that use OR expressions, or those that use LIMIT or return
      many rows, the 'y' matchinfo option may incur significantly less overhead
      than 'x'.

  <tr><td>n <td>1 <td>The number of rows in the FTS4 table. This value is
    only available when querying FTS4 tables, not FTS3.
  <tr><td>a <td><i>cols</i> <td>For each column, the average number of
    tokens in the text values stored in the column (considering all rows in
    the FTS4 table). This value is only available when querying FTS4 tables,
    not FTS3.