Commit 4c68eb0d5b9492c23ab5b49977560d7c3361d4f1
reinstate fulltext search
mix irving committed on 4/1/2017, 10:54:51 AMParent: 364194e32458712cc0a1f6cd0e651f56556f0dba
Files changed
router/html/page/search.js | changed |
router/html/page/search.js | ||
---|---|---|
@@ -10,10 +10,12 @@ | ||
10 | 10 | |
11 | 11 | exports.needs = nest({ |
12 | 12 | 'main.html.scroller': 'first', |
13 | 13 | '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 | + } | |
16 | 18 | }) |
17 | 19 | |
18 | 20 | var whitespace = /\s+/ |
19 | 21 | |
@@ -121,30 +123,22 @@ | ||
121 | 123 | pull.filter(matchesQuery), |
122 | 124 | Scroller(container, content, renderMsg, true, false) |
123 | 125 | ) |
124 | 126 | |
125 | - // <Temp> | |
126 | - search.isLinear.set(true) | |
127 | 127 | 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 | + }), | |
147 | 141 | pull.through(() => search.matches.set(search.matches() + 1)), |
148 | 142 | Scroller(container, content, renderMsg, false, false) |
149 | 143 | ) |
150 | 144 |
Built with git-ssb-web