diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-26 08:56:30 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-26 08:56:30 -0400 |
commit | 3b3cc234eb87ad3358671944537300ac17a9db41 (patch) | |
tree | 86bf26a4a0ea1072be8c944d52cf0ebf798d350d /web/react/components/search_bar.jsx | |
parent | f05da1fa6d028bfb15b2838abbb7976c29bff1cd (diff) | |
parent | e9812655f6cb7e9e6c06bc1b2a462efc106f52f7 (diff) | |
download | chat-3b3cc234eb87ad3358671944537300ac17a9db41.tar.gz chat-3b3cc234eb87ad3358671944537300ac17a9db41.tar.bz2 chat-3b3cc234eb87ad3358671944537300ac17a9db41.zip |
Merge pull request #1181 from girishso/star-search2
PLT-747: Allow search results to match portions of words
Diffstat (limited to 'web/react/components/search_bar.jsx')
-rw-r--r-- | web/react/components/search_bar.jsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx index e1d36ad7d..0da43e8cd 100644 --- a/web/react/components/search_bar.jsx +++ b/web/react/components/search_bar.jsx @@ -105,8 +105,15 @@ export default class SearchBar extends React.Component { performSearch(terms, isMentionSearch) { if (terms.length) { this.setState({isSearching: true}); + + // append * if not present + let searchTerms = terms; + if (searchTerms.search(/\*\s*$/) === -1) { + searchTerms = searchTerms + '*'; + } + client.search( - terms, + searchTerms, (data) => { this.setState({isSearching: false}); if (utils.isMobile()) { |