diff --git a/app/models/search/work_indexer.rb b/app/models/search/work_indexer.rb index 36978eef04c..77ffdf002a6 100644 --- a/app/models/search/work_indexer.rb +++ b/app/models/search/work_indexer.rb @@ -38,7 +38,7 @@ def self.mapping }, title: { type: "text", - analyzer: "simple" + analyzer: "standard" }, creators: { type: "text" diff --git a/features/fixtures/works.yml b/features/fixtures/works.yml index 98039686618..d12c46068c0 100644 --- a/features/fixtures/works.yml +++ b/features/fixtures/works.yml @@ -11,7 +11,7 @@ first: second: id: 2 posted: true - title: second work + title: second work (2 of 6) word_count: 1000 title_to_sort_on: second work language: english @@ -61,4 +61,4 @@ sixth: created_at: 2013-04-30 revised_at: 2013-04-30 expected_number_of_chapters: 2 - complete: false \ No newline at end of file + complete: false diff --git a/features/search/works_info.feature b/features/search/works_info.feature index 568932b9000..d88ed5aab0f 100644 --- a/features/search/works_info.feature +++ b/features/search/works_info.feature @@ -139,3 +139,17 @@ Feature: Search works by work info Then the field labeled "Title" should contain "work" And "Title" should be selected within "Sort by" And "Ascending" should be selected within "Sort direction" + + Scenario: Search by number in title + Given I have loaded the fixtures + When I am on the search works page + And I fill in "Title" with "work 2 6" + And I press "Search" within "#new_work_search" + Then I should see "You searched for: Title: work 2 6" + And I should see "1 Found" + And the 1st result should contain "second work (2 of 6)" + When I am on the search works page + And I fill in "Title" with "work 1" + And I press "Search" within "#new_work_search" + Then I should see "You searched for: Title: work 1" + And I should see "No results found"