Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/search/bookmark_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.mapping
},
tag: {
type: "text",
analyzer: "simple"
analyzer: "standard"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may be able to remove this line, the standard analyzer should be the default, but I would wait until an official volunteer confirms before removing. Looking through the code there are some explicit instances of analyzer: "standard", so might be totally fine as is!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll wait until there's confirmation. Thanks for reviewing my PR!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine to keep explicit. Generally, I would say that we have no set style preference for this situation.

Personally, I like when a decision like this has an easy to follow git blame for why it is the way it is, so keeping this line makes it easier to git blame -> find this pr -> find the related test and jira issue

},
sort_id: {
type: "keyword"
Expand Down
16 changes: 16 additions & 0 deletions features/bookmarks/bookmark_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,19 @@ Feature: Filter bookmarks
Then I should see "2 Bookmarks by recengine"
And I should see "english work"
And I should see "german work"

Scenario: When a bookmark with a tag is searched for, only bookmarks with
the searched tag should appear
Given I am logged in as "author"
And I post the work "An Example Work"
And I post the work "Another Example Work"
And I am logged in as "bookmarker"
And I bookmark the work "An Example Work" with the tags "1k"
And I bookmark the work "Another Example Work" with the tags "2k"
When I go to bookmarker's user page
And I follow "Bookmarks (2)"
And I fill in "Search bookmarker's tags and notes" with "2k"
And I press "Sort and Filter"
Then I should see "1 Bookmark found by bookmarker"
And the 1st bookmark result should contain "Another Example Work"
And I should not see "An Example Work"
Loading