Search Insights widget displays the Request and Response JSON in 'pretty' format when Elasticsearch is the search engine

Description

Problem

When the search engine is Elasticsearch, the output is a JSON and it is displayed without formatting (see the screenshot attached)

  1. Start portal

  2. Go the default 'search' page http://localhost:8080/web/guest/search

  3. Add the Search Insights widget to the page

  4. Execute a random search

Negative Consequences

Readability is limited, forces the admin to copy-paste and format the text manually.

Acceptance Criteria

  1. Pretty-print the JSON output for the Request and the Response in the Search Insights widget. It applies to the Elasticsearch engine only, the Solr query string looks different, not a JSON.

  2. "Copy to clipboard" button added to both Request and Response sections

Impact

Improved readability. No need to format the text manually.

Docs

https://learn.liferay.com/dxp/latest/en/using-search/search-pages-and-widgets/search-insights.html

Attachments

2

Activity

Show:

Brian Lee March 23, 2022 at 1:04 PM

PASSED testing following the steps in the description. The following functional test also pass after these changes:

  • Elasticsearch7#AssertSearchInsightsExplain

  • Blueprints#ApplyBlueprintJSONToSearchViaLLSO

Tested on:

Tomcat 9.0.56 + MySQL 5.7
Portal master SHA: efd508a807841fc9ae7723e2af8582f83a82c7a9

Tibor Lipusz March 23, 2022 at 4:47 AM

I can just second to what Kevin wrote in his review:

I definitely do like the how the textarea appears first so immediate results appear before codemirror steps in so there isn't a page shift.

Nice work, !

Tibor Lipusz February 14, 2019 at 2:30 AM

Another improvement could be to add a "Copy-to-clipboard" button to the widget.

Completed

Details

Assignee

Reporter

Engineering Assignee

Git Pull Request

Development End Date

Mar 16, 2022, 5:01 PM

Development Start Date

Mar 11, 2022, 12:36 PM

Frontend Developer(s) Assigned

Olivia Yu

QA Engineer(s) Assigned

Brian Lee

Story Points

Components

Priority

Zendesk Support

Created February 14, 2019 at 2:14 AM
Updated March 21, 2024 at 2:03 PM
Resolved March 23, 2022 at 1:05 PM
Loading...