Handbook
Glossary
<search-articles-action> ( -- action )
Vocabulary
webapps
.
wiki
Inputs
None
Outputs
action
an
object
Definition
USING:
accessors
db.tuples
furnace.actions
html.forms
http.server
kernel
regexp
sequences
simple-tokenizer
sorting
splitting
unicode
;
IN:
webapps.wiki
:
<search-articles-action>
( -- action )
<page-action>
[
"search"
param
[
blank?
]
trim
dup
"search"
set-value
[
f
]
[
tokenize
[
" "
" +"
replace
"\\b"
dup
surround
"i"
<optioned-regexp>
]
map
]
if-empty
[
f
]
[
f
<article>
select-tuples
[
title>>
]
sort-by
[
revision>>
<revision>
select-tuple
]
map
swap
[
[
content>>
]
]
dip
[
[
first-match
]
with
all?
]
curry
compose
filter
]
if-empty
[
"results"
set-value
]
[
not
"empty"
set-value
]
bi
]
>>init
{
wiki
"search"
}
>>template
;