SQLite

Check-in [da7abe0588]
Login

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

Overview
Comment:Fix some matchinfo related test problems in fts3rnd.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: da7abe05887d1ad52552d8ce3a153a0a76f96c5a
User & Date: dan 2010-01-14 11:17:05.000
Context
2010-01-14
11:45
Add a test to e_fts3.test for the matchinfo example in fts3.html. (check-in: e5336edc55 user: dan tags: trunk)
11:17
Fix some matchinfo related test problems in fts3rnd.test. (check-in: da7abe0588 user: dan tags: trunk)
00:39
Comment cleanup in sqliteInt.h. (check-in: 67c3aea563 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to test/fts3rnd.test.
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
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







+
+

-
-
-
+
+
+
+
+
+
+
+

-
+

-
+

-
-
-
+
+
+
+

+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+







    }
  }

  #lsort -uniq -integer $ret
  set ret
}

# This [proc] is used to test the FTS3 matchinfo() function.
# 
proc simple_token_matchinfo {zToken} {
  set total(0) 0
  set total(1) 0
  set total(2) 0

  set nDoc(0) 0
  set nDoc(1) 0
  set nDoc(2) 0
  set nHit(0) 0
  set nHit(1) 0
  set nHit(2) 0


  foreach key [lsort -integer [array names ::t1]] {
  foreach key [array names ::t1] {
    set value $::t1($key)
    set cnt [list]
    set a($key) [list]
    foreach i {0 1 2} col $value {
      set n [llength [lsearch -all $col $zToken]]
      lappend cnt $n
      incr total($i) $n
      set hit [llength [lsearch -all $col $zToken]]
      lappend a($key) $hit
      incr nHit($i) $hit
      if {$hit>0} { incr nDoc($i) }
    }
  }

  set ret [list]
  foreach docid [lsort -integer [array names a]] {
    if {[lindex [lsort $cnt] end]} {
      lappend ret $key [concat 1 3 XXX $cnt]
    }
  }
  
  string map [list XXX "$total(0) $total(1) $total(2)"] $ret
    if { [lindex [lsort -integer $a($docid)] end] } {
      set matchinfo [list 1 3]
      foreach i {0 1 2} hit $a($docid) {
        lappend matchinfo $hit $nHit($i) $nDoc($i)
      }
      lappend ret $docid $matchinfo
    }
  }

  set ret
} 

proc simple_near {termlist nNear} {
  set ret [list]

  foreach {key value} [array get ::t1] {
    foreach v $value {