vnews 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -1
- data/lib/vnews/display.rb +6 -1
- data/lib/vnews/sql.rb +1 -1
- data/lib/vnews/version.rb +1 -1
- data/lib/vnews.vim +0 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -219,10 +219,13 @@ session using `elinks` or whatever browser you set as your
|
|
219
219
|
|
220
220
|
* `:VNSearch [term]` searches your feeds for items matching `[term]`
|
221
221
|
|
222
|
-
|
223
222
|
You can use the abbreviation `:VNS`. If there are matches, you'll see
|
224
223
|
the matching words color-highlighted.
|
225
224
|
|
225
|
+
You'll also see the match score in the column to the right of the title column.
|
226
|
+
The higher the number, the more relevant the match.
|
227
|
+
|
228
|
+
Search results are sorted by publication date.
|
226
229
|
|
227
230
|
## Concatenating feed items
|
228
231
|
|
data/lib/vnews/display.rb
CHANGED
@@ -65,7 +65,12 @@ class Vnews
|
|
65
65
|
def format_item_summary(i, width)
|
66
66
|
varwidth = width.to_i - 35
|
67
67
|
feed_title = col i['feed_title'], varwidth * 0.25
|
68
|
-
title =
|
68
|
+
title = if i['score'] # search result
|
69
|
+
width = varwidth * 0.75
|
70
|
+
"#{col(i['title'], (width - 6))} | #{"%.3s" % i['score']}"
|
71
|
+
else
|
72
|
+
col i['title'], varwidth * 0.75
|
73
|
+
end
|
69
74
|
word_count = i['word_count'].to_s.rjust(6)
|
70
75
|
date = format_date(i['pub_date']).rjust(8)
|
71
76
|
spacer = " " * 20 # to push guid all the way off screen
|
data/lib/vnews/sql.rb
CHANGED
@@ -176,7 +176,7 @@ class Vnews
|
|
176
176
|
end
|
177
177
|
|
178
178
|
def search_items(term)
|
179
|
-
query = "select
|
179
|
+
query = "select items.*, MATCH(title, text) against('#{e term}') as score from items where MATCH(title, text) against('#{e term}') order by pub_date asc"
|
180
180
|
@client.query query
|
181
181
|
end
|
182
182
|
|
data/lib/vnews/version.rb
CHANGED
data/lib/vnews.vim
CHANGED