git ssb

16+

Dominic / patchbay



Commit 4c68eb0d5b9492c23ab5b49977560d7c3361d4f1

reinstate fulltext search

mix irving committed on 4/1/2017, 10:54:51 AM
Parent: 364194e32458712cc0a1f6cd0e651f56556f0dba

Files changed

router/html/page/search.jschanged
router/html/page/search.jsView
@@ -10,10 +10,12 @@
1010
1111 exports.needs = nest({
1212 'main.html.scroller': 'first',
1313 'message.html.render': 'first',
14- 'sbot.pull.log': 'first'
15- // sbot_fulltext_search: 'first' // TODO add to core?
14+ 'sbot.pull': {
15+ log: 'first',
16+ search: 'first'
17+ }
1618 })
1719
1820 var whitespace = /\s+/
1921
@@ -121,30 +123,22 @@
121123 pull.filter(matchesQuery),
122124 Scroller(container, content, renderMsg, true, false)
123125 )
124126
125- // <Temp>
126- search.isLinear.set(true)
127127 pull(
128- next(api.sbot.pull.log, {reverse: true, limit: 500, live: false}),
129- pull.through(() => search.linear.checked.set(search.linear.checked() + 1)),
130- pull.filter(matchesQuery),
131- // </Temp>
132- // TODO - reinstate fulltext search
133- // pull(
134- // next(api.sbot_fulltext_search, {query: queryStr, reverse: true, limit: 500, live: false}),
135- // fallback((err) => {
136- // if (err === true) {
137- // search.fulltext.isDone.set(true)
138- // } else if (/^no source/.test(err.message)) {
139- // search.isLinear.set(true)
140- // return pull(
141- // next(api.sbot_log, {reverse: true, limit: 500, live: false}),
142- // pull.through(() => search.linear.checked.set(search.linear.checked()+1)),
143- // pull.filter(matchesQuery)
144- // )
145- // }
146- // }),
128+ next(api.sbot.pull.search, {query: queryStr, reverse: true, limit: 500, live: false}),
129+ fallback((err) => {
130+ if (err === true) {
131+ search.fulltext.isDone.set(true)
132+ } else if (/^no source/.test(err.message)) {
133+ search.isLinear.set(true)
134+ return pull(
135+ next(api.sbot_log, {reverse: true, limit: 500, live: false}),
136+ pull.through(() => search.linear.checked.set(search.linear.checked()+1)),
137+ pull.filter(matchesQuery)
138+ )
139+ }
140+ }),
147141 pull.through(() => search.matches.set(search.matches() + 1)),
148142 Scroller(container, content, renderMsg, false, false)
149143 )
150144

Built with git-ssb-web