Problem/Motivation

There are two issues here, but since they both have to do with URLs returned in the REST resource response, I'm lumping them in together

  1. Search results ignore the 'Remove Domain from Result Link URLs' configuration. This was a useful feature so that when testing search on a lower environment, the search results would have relative links and would link to the lower environment instead of all the results linking back to prodution.
  2. The tokens for the original URL and corrected URL are populated based on the server environment and not based on the client environment. For clients that use the API, the domain and path of the search page can be anything. When a search keyword is corrected but you want to provide a link to perform the search against the wrongly spelled word anyway the link should be based on the client search path and not on the server custom search page path.

Steps to reproduce

  1. Make a call to the REST resource for a custom search page. In the response, you will see that the results all have absolute links to the production environment.
  2. Make a call to the REST resource for a custom search page. Use an improperly spelled word that will get corrected. Examine the originalUrl returned in the response. It shows the URL associated with the custom search page on the server side rather than the url of the client search page.

Proposed resolution

  1. Move the process of removing the domain from sesarch results into the search service rather than in the presentation logic. This works fine when not using a decoupled architecture and the search page on Drupal. It fails when the search page lives on a client that uses the REST resource to get the results.
  2. Accept a 'searchPath' query string parameter that can be added to the query string of search requests. Also, have a setting that sets a default searchPath for clients that use the api.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

timozura created an issue. See original summary.

timozura’s picture

Status: Active » Needs review
mkinnune’s picture

Status: Needs review » Reviewed & tested by the community

timozura’s picture

Version: 1.0.x-dev » 1.8.2-rc1
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.