Skip to content

Commit

Permalink
Keyword searches should be ordered by relevance
Browse files Browse the repository at this point in the history
Users will be able to change the order of the results should they wish,
however we should use the relevancy calculated by elasticsearch to help
users find what they want.
  • Loading branch information
sihugh committed May 22, 2019
1 parent d2f27b3 commit 66b1682
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Presenters
class PotentialSearchActionSchema
attr_reader :facet_params

BASE_SEARCH_URL = "#{Plek.current.website_root}/search/all?keywords={query}".freeze
BASE_SEARCH_URL = "#{Plek.current.website_root}/search/all?keywords={query}&order=relevance".freeze

def initialize(facet_params)
@facet_params = facet_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

search_action = {
"@type": "SearchAction",
"target": "http://www.dev.gov.uk/search/all?keywords={query}&manual=%2Fguidance%2Fplane-manual",
"target": "http://www.dev.gov.uk/search/all?keywords={query}&order=relevance&manual=%2Fguidance%2Fplane-manual",
"query": "required"
}
expect(structured_data['potentialAction']).to eql(search_action)
Expand Down Expand Up @@ -80,7 +80,7 @@

search_action = {
"@type": "SearchAction",
"target": "http://www.dev.gov.uk/search/all?keywords={query}&organisations%5B%5D=ministry-of-magic",
"target": "http://www.dev.gov.uk/search/all?keywords={query}&order=relevance&organisations%5B%5D=ministry-of-magic",
"query": "required"
}

Expand Down

0 comments on commit 66b1682

Please sign in to comment.