Support searching for threads by regular expressions on a given field using syntax field:/regexp/
This commit is contained in:
parent
8a50059795
commit
8cd7b2cc08
@ -943,6 +943,13 @@ Index =
|
|||||||
Index.pageLoad false
|
Index.pageLoad false
|
||||||
|
|
||||||
querySearch: (query) ->
|
querySearch: (query) ->
|
||||||
|
if (match = query.match /^([\w+]+):\/(.*)\/(\w*)$/)
|
||||||
|
try
|
||||||
|
regexp = RegExp match[2], match[3]
|
||||||
|
catch
|
||||||
|
return []
|
||||||
|
return Index.sortedThreadIDs.filter (ID) ->
|
||||||
|
regexp.test(Filter.value(match[1], Index.parsedThreads[ID]) or '')
|
||||||
return if not (keywords = query.toLowerCase().match /\S+/g)
|
return if not (keywords = query.toLowerCase().match /\S+/g)
|
||||||
Index.sortedThreadIDs.filter (ID) ->
|
Index.sortedThreadIDs.filter (ID) ->
|
||||||
Index.searchMatch Index.parsedThreads[ID], keywords
|
Index.searchMatch Index.parsedThreads[ID], keywords
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user