Unexpected Search Result

Marc has noted that sometime wiki's incremental search result shows as a tiny white empty box. No amount of reloading clears this condition.

# Grep

Paul suggested we look for error messages in the server. I found a few in the last 1,000,000 log entries with grep.

journalctl -u wiki -n1000000 | grep 'SITE INDEX ***'

Aug 31 11:16:25 asia wiki[18973]: SITE INDEX *** createIndex test2.ward.dojo.fed.wiki error: [Error: ENOENT: no such file or directory, scandir '/root/.wiki/test2.ward.dojo.fed.wiki/pages'
Aug 31 11:19:03 asia wiki[18973]: SITE INDEX *** createIndex test2.ward.dojo.fed.wiki error: [Error: ENOENT: no such file or directory, scandir '/root/.wiki/test2.ward.dojo.fed.wiki/pages'
Aug 31 11:26:39 asia wiki[18973]: SITE INDEX *** createIndex test2.ward.dojo.fed.wiki error: [Error: ENOENT: no such file or directory, scandir '/root/.wiki/test2.ward.dojo.fed.wiki/pages'
Aug 31 20:10:02 asia wiki[18973]: SITE INDEX *** marc.tries.fed.wiki reduce to extract text on marcs-site-list-as-urls failed Error extracting text from 0
Aug 31 20:10:18 asia wiki[18973]: SITE INDEX *** clive.tries.fed.wiki reduce to extract text on student-interactions-in-edmodo-versus-facebook failed Error extracting text from 4
Sep 01 01:33:37 asia wiki[1205]: SITE INDEX *** createIndex silke.fed.wiki error: [Error: ENOENT: no such file or directory, scandir '/root/.wiki/silke.fed.wiki/pages'
Sep 05 05:52:36 asia wiki[17000]: SITE INDEX *** marc.tries.fed.wiki reduce to extract text on marcs-site-list-as-urls failed Error extracting text from 0
Sep 05 05:53:12 asia wiki[17050]: SITE INDEX *** marc.tries.fed.wiki reduce to extract text on marcs-site-list-as-urls failed Error extracting text from 0
Sep 05 05:53:52 asia wiki[17106]: SITE INDEX *** marc.tries.fed.wiki reduce to extract text on marcs-site-list-as-urls failed Error extracting text from 0

Paul will harden the index logic and report a few more conditions that might suggest a solution.

# Deno

I can run batch minisearch and use it to test every index stored in my server. skypack github

import MiniSearch from 'https://cdn.skypack.dev/minisearch@3.3.0'

[Function: MiniSearch2] { loadJSON: [Function], getDefault: [Function], loadJS: [Function] }

A test case, search for "graph merge demo" on my dojo site. Then repeat for marc.tries.fed.wiki.

Search for "graph merge demo" yields three results.

With some reading around in wiki-client we were able to duplicate this result.

const query = 'graph merge demo' const results = miniSearch.search(query,{ boost:{ title: 20, content: 2}, prefix: true, combineWith: 'AND' })

[
  {
    id: "travel-graph-demo",
    terms: [ "graph", "merge", "demo" ],
    score: 804.3929281858361,
    match: { graph: [ "title", "content" ], merge: [ "content" ], demo: [ "title" ] }
  },
  {
    id: "subgraph-creator",
    terms: [ "graph", "graphs", "merge", "demonstrate" ],
    score: 377.71676225404434,
    match: {
      graph: [ "content" ],
      graphs: [ "content" ],
      merge: [ "content" ],
      demonstrate: [ "content" ]
    }
  },
  {
    id: "more-more-garden",
    terms: [ "graphs", "graphviz", "merge", "demo", "demos", "democracy" ],
    score: 13.363907653389663,
    match: {
      graphs: [ "content" ],
      graphviz: [ "content" ],
      merge: [ "content" ],
      demo: [ "content" ],
      demos: [ "content" ],
      democracy: [ "content" ]
    }
  }
]

We try searching for all two letter combinations suspecting that for some sites this will throw an exception. For ward.dojo.fed.wiki we see no errors. For marc.tries.fed.wiki we see many.

aa 12
ab Cannot read properties of undefined (reading '1')
ac Cannot read properties of undefined (reading '1')
ad 695
ae 69
af 342
ag Cannot read properties of undefined (reading '1')
ah 29
ai 167
aj 3
ak 18
al 1115
am 434
an Cannot read properties of undefined (reading '1')
ao 4
ap 575
aq 4
ar 1299
as Cannot read properties of undefined (reading '1')
at 764
au 313
av 254
aw 174
ax 16
ay 2
az 4
ba 832
bb 8
bc 8
bd 9
be 1498
bf 1
bg 105
bh 3
bi 393
bj 7
bk 2
bl 224
bm 2
bn 2
bo 629
bp 4
bq 1
br 503
bs 2
bt 6
bu Cannot read properties of undefined (reading '1')
bv 1
bw 2
bx 1
by 821
bz 1
ca 1320
cb 4
cc 34
cd 9
ce 324
cf 25
cg 6
ch 1020
ci Cannot read properties of undefined (reading '1')
cj 2
ck 1
cl 668
cm 4
cn 5
co Cannot read properties of undefined (reading '1')
cp 14
cq 2
cr Cannot read properties of undefined (reading '1')
cs 33
ct 2
cu 613
cv 14
cw 1
cx 3
cy 162
cz 1
da 509
db 21
dc 7
dd 10
de 1450
df 7
dg 2
dh 9
di 1325
dj 1
dk 1
dl 1
dm 38
dn 12
do Cannot read properties of undefined (reading '1')
dp 4
dq 1
dr 445
ds 22
dt 3
du 193
dv 3
dw 11
dx 1
dy 191
dz 2
ea 667
eb 5
ec 375
ed 455
ee 7
ef 316
eg 28
eh 2
ei 88
ej 2
ek 1
el 405
em 484
en 1062
eo 2
ep 56
eq 199
er 162
es 340
et Cannot read properties of undefined (reading '1')
eu 27
ev 663
ew 3
ex 1084
ey 23
ez 2
fa 762
fb 5
fc 5
fd 2
fe 834
ff 15
fg 1
fh 1
fi 971
fj 2
fk 1
fl 256
fm 6
fn 4
fo Cannot read properties of undefined (reading '1')
fp 2
fq 2
fr Cannot read properties of undefined (reading '1')
fs 1
ft 10
fu 603
fv 1
fw 12
fx 2
fy 1
fz 1
ga 267
gb 1
gc 1
gd 11
ge 644
gf 3
gg 7
gh 8
gi 351
gj 1
gk 1
gl 170
gm 11
gn 2
go Cannot read properties of undefined (reading '1')
gp 4
gq 2
gr 942
gs 3
gt 13
gu 243
gv 1
gw 2
gx 1
gy 7
gz 3
ha 1121
hb 2
hc 2
hd 1
he Cannot read properties of undefined (reading '1')
hf 2
hg 1
hh 2
hi 539
hj 1
hk 2
hl 1
hm 2
hn 1
ho 1023
hp 4
hq 1
hr 5
hs 3
ht 376
hu 388
hv 1
hw 2
hx 1
hy 123
hz 1
ia 17
ib 8
ic 44
id 520
ie 6
if 444
ig 40
ih 10
ii 21
ij 1
ik 2
il 192
im 729
in 1942
io 55
ip 28
iq 1
ir 51
is Cannot read properties of undefined (reading '1')
it Cannot read properties of undefined (reading '1')
iu 3
iv 18
iw 1
ix 3
iy 1
iz 1
ja 156
jb 1
jc 1
jd 7
je 34
jf 1
jg 2
jh 1
ji 21
jj 1
jk 1
jl 2
jm 7
jn 1
jo 397
jp 18
jq 5
jr 3
js 67
jt 1
ju 362
jv 1
jw 3
jx 1
jy 1
jz 2
ka 63
kb 3
kc 1
kd 1
ke Cannot read properties of undefined (reading '1')
kf 1
kg 2
kh 2
ki 236
kj 1
kk 1
kl 2
km 3
kn 416
ko 23
kp 2
kq 1
kr 9
ks 2
kt 5
ku 16
kv 2
kw 3
kx 1
ky 3
kz 1
la Cannot read properties of undefined (reading '1')
lb 3
lc 2
ld 1
le Cannot read properties of undefined (reading '1')
lf 3
lg 1
lh 8
li Cannot read properties of undefined (reading '1')
lj 1
lk 1
ll 61
lm 1
ln 3
lo 970
lp 1
lq 1
lr 2
ls 3
lt 12
lu 43
lv 2
lw 2
lx 1
ly 9
lz 1
ma 1537
mb 11
mc 47
md 49
me 1118
mf 2
mg 5
mh 1
mi 663
mj 1
mk 2
ml 1
mm 4
mn 5
mo Cannot read properties of undefined (reading '1')
mp 6
mq 1
mr 8
ms 9
mt 16
mu Cannot read properties of undefined (reading '1')
mv 2
mw 2
mx 2
my 368
mz 1
na Cannot read properties of undefined (reading '1')
nb 40
nc 105
nd 58
ne 1339
nf 45
ng 39
nh 35
ni 148
nj 16
nk 4
nl 54
nm 57
nn 22
no 1268
np 79
nq 8
nr 64
ns Cannot read properties of undefined (reading '1')
nt 46
nu 291
nv 20
nw 30
nx 2
ny 7
nz 4
oa 12
ob 343
oc 151
od 25
oe 4
of 1848
og 1
oh 22
oi 8
oj 2
ok 28
ol 121
om 23
on 1251
oo 13
op 649
oq 1
or 1334
os 92
ot 637
ou 815
ov 499
ow 305
ox 13
oy 2
oz 2
pa 1359
pb 8
pc 6
pd 45
pe 1086
pf 2
pg 6
ph 354
pi 300
pj 2
pk 1
pl 813
pm 5
pn 36
po 1008
pp 14
pq 1
pr 1516
ps 75
pt 9
pu 600
pv 1
pw 1
px 1
py 9
pz 1
qa 1
qb 5
qc 3
qd 1
qe 2
qf 2
qg 1
qh 1
qi 1
qj 1
qk 1
ql 2
qm 2
qn 1
qo 1
qp 1
qq 1
qr 1
qs 2
qt 3
qu 538
qv 1
qw 1
qx 1
qy 2
qz 2
ra 708
rb 3
rc 6
rd 4
re Cannot read properties of undefined (reading '1')
rf 1
rg 5
rh 26
ri 389
rj 1
rk 2
rl Cannot read properties of undefined (reading '1')
rm 5
rn 9
ro 555
rp 5
rq 1
rr 7
rs 10
rt 3
ru 268
rv 3
rw 6
rx 41
ry 4
rz 1
sa 658
sb 15
sc 668
sd 31
se Cannot read properties of undefined (reading '1')
sf 11
sg 1
sh 923
si 991
sj 1
sk 196
sl 147
sm 254
sn 54
so Cannot read properties of undefined (reading '1')
sp 723
sq 36
sr 14
ss 15
st Cannot read properties of undefined (reading '1')
su 1106
sv 59
sw 71
sx 1
sy Cannot read properties of undefined (reading '1')
sz 2
ta Cannot read properties of undefined (reading '1')
tb 13
tc 3
td 9
te Cannot read properties of undefined (reading '1')
tf 1
tg 8
th Cannot read properties of undefined (reading '1')
ti Cannot read properties of undefined (reading '1')
tj 1
tk 1
tl 7
tm 4
tn 5
to 1864
tp 2
tq 1
tr 937
ts 6
tt 1
tu 167
tv 3
tw 294
tx 8
ty 229
tz 1
ua 2
ub 13
uc 2
ud 8
ue 3
uf 1
ug 13
uh 20
ui 13
uj 1
uk 29
ul 55
um 32
un Cannot read properties of undefined (reading '1')
uo 1
up 506
uq 1
ur Cannot read properties of undefined (reading '1')
us Cannot read properties of undefined (reading '1')
ut 41
uu 1
uv 1
uw 3
ux 2
uy 2
uz 2
va Cannot read properties of undefined (reading '1')
vb 5
vc 1
vd 1
ve 474
vf 1
vg 1
vh 2
vi 640
vj 1
vk 1
vl 2
vm 3
vn 1
vo 145
vp 4
vq 1
vr 4
vs 203
vt 2
vu 17
vv 1
vw 2
vx 1
vy 1
vz 1
wa 980
wb 5
wc 4
wd 3
we 1211
wf 2
wg 2
wh Cannot read properties of undefined (reading '1')
wi Cannot read properties of undefined (reading '1')
wj 1
wk 4
wl 2
wm 1
wn 1
wo 1015
wp 12
wq 2
wr 339
ws 3
wt 9
wu 3
wv 1
ww 59
wx 1
wy 15
wz 1
xa 4
xb 1
xc 1
xd 1
xe 4
xf 2
xg 1
xh 1
xi 9
xj 1
xk 1
xl 5
xm 5
xn 2
xo 3
xp 11
xq 2
xr 2
xs 1
xt 2
xu 2
xv 3
xw 2
xx 6
xy 7
xz 1
ya 27
yb 3
yc 1
yd 2
ye 286
yf 1
yg 1
yh 1
yi 36
yj 1
yk 1
yl 1
ym 2
yn 1
yo 593
yp 1
yq 2
yr 1
ys 1
yt 3
yu 3
yv 1
yw 1
yx 1
yy 3
yz 1
za 5
zb 1
zc 1
zd 1
ze 40
zf 1
zg 1
zh 1
zi 6
zj 1
zk 1
zl 2
zm 1
zn 1
zo 44
zp 2
zq 1
zr 1
zs 1
zt 1
zu 7
zv 2
zw 1
zx 1
zy 2
zz 3