diff --git a/domain/search/store.go b/domain/search/store.go index 301d2761..1520575d 100644 --- a/domain/search/store.go +++ b/domain/search/store.go @@ -266,6 +266,11 @@ func (s Store) matchFullText(ctx domain.RequestContext, keywords, itemType strin switch s.Runtime.StoreProvider.Type() { case env.StoreTypeMySQL: + // Tag names can contain hyphens so we have to wrap text in double quotes + // and then the query parser wraps in single quotes. + if itemType == "tag" { + keywords = fmt.Sprintf("\"%s\"", keywords) + } fts = " AND MATCH(s.c_content) AGAINST(? IN BOOLEAN MODE) " case env.StoreTypePostgreSQL: // By default, we expect no Postgres full text search operators. diff --git a/gui/app/components/search/search-view.js b/gui/app/components/search/search-view.js index 2f88a2f1..3fabb2a3 100644 --- a/gui/app/components/search/search-view.js +++ b/gui/app/components/search/search-view.js @@ -29,23 +29,8 @@ export default Component.extend({ this.set('keywords', this.get('filter')); this.set('matchFilter', this.get('matchFilter')); this.fetch(); - console.log('receive a'); }, - didReceiveAttrs() { - this._super(...arguments); - // this.set('keywords', this.get('filter')); - this.set('matchFilter', this.get('matchFilter')); - this.fetch(); - console.log('update a'); - }, - - // didUpdateAttrs() { - // this._super(...arguments); - // this.fetch(); - // console.log('update a'); - // }, - fetch() { let payload = { keywords: this.get('keywords'), diff --git a/gui/app/styles/core/view/search.scss b/gui/app/styles/core/view/search.scss index f72ec1a0..c0bdb177 100644 --- a/gui/app/styles/core/view/search.scss +++ b/gui/app/styles/core/view/search.scss @@ -80,15 +80,23 @@ } .hashtags { - > .hashtag { - display: inline-block; - margin: 5px 10px 0 5px; - color: map-get($gray-shades, 600); - font-size: 1rem; - font-style: italic; + display: inline-block; + padding: 0; - &:hover { - color: $color-link; + > .hashtag { + padding: 0 15px 0 0; + + > .dicon { + color: map-get($gray-shades, 500); + font-size: 20px; + vertical-align: bottom; + padding: 0 5px 0 0; + } + + > .name { + display: inline-block; + color: map-get($gray-shades, 800); + font-size: 1rem; } } } diff --git a/gui/app/templates/components/folder/document-tags.hbs b/gui/app/templates/components/folder/document-tags.hbs index 44641ec3..e6460c26 100644 --- a/gui/app/templates/components/folder/document-tags.hbs +++ b/gui/app/templates/components/folder/document-tags.hbs @@ -1,5 +1,5 @@ {{#each tagz as |tg|}} - {{#link-to "search" (query-params filter=tg) class="hashtag"}} + {{#link-to "search" (query-params filter=tg matchTag=true matchContent=false matchFile=false matchDoc=false) class="hashtag"}}