Details
-
Bug
-
Status: Selected for Development
-
Resolution: Unresolved
-
7.3.10.3 DXP SP3, 7.4.13 DXP U5, Master
-
None
-
- 7.4-known-issues
- liferay-ga15-ce-743-known-issues
- liferay-ga16-ce-743-known-issues
- liferay-ga17-ce-743-known-issues
- liferay-ga18-ce-743-known-issues
- liferay-ga19-ce-743-known-issues
- liferay-ga20-ce-743-known-issues
- liferay-ga21-ce-743-known-issues
- liferay-ga22-ce-743-known-issues
- liferay-ga23-ce-743-known-issues
- liferay-ga24-ce-743-known-issues
- liferay-ga25-ce-743-known-issues
- liferay-ga26-ce-743-known-issues
- liferay-ga27-ce-743-known-issues
- liferay-ga28-ce-743-known-issues
- liferay-ga29-ce-743-known-issues
- liferay-ga30-ce-743-known-issues
- liferay-ga31-ce-743-known-issues
- liferay-ga32-ce-743-known-issues
- liferay-ga33-ce-743-known-issues
- liferay-ga34-ce-743-known-issues
- liferay-ga35-ce-743-known-issues
- liferay-ga36-ce-743-known-issues
- liferay-ga37-ce-743-known-issues
- liferay-ga38-ce-743-known-issues
- liferay-ga39-ce-743-known-issues
- liferay-ga40-ce-743-known-issues
- liferay-ga41-ce-743-known-issues
- liferay-ga42-ce-743-known-issues
- liferay-ga44-ce-743-known-issues
- liferay-ga45-ce-743-known-issues
- liferay-ga46-ce-743-known-issues
- liferay-ga47-ce-743-known-issues
- liferay-ga48-ce-743-known-issues
- liferay-ga49-ce-743-known-issues
- liferay-ga50-ce-743-known-issues
- liferay-ga51-ce-743-known-issues
- liferay-ga52-ce-743-known-issues
- liferay-ga53-ce-743-known-issues
- liferay-ga54-ce-743-known-issues
- liferay-ga55-ce-743-known-issues
- liferay-ga56-ce-743-known-issues
- liferay-ga57-ce-743-known-issues
- liferay-ga58-ce-743-known-issues
- liferay-ga59-ce-743-known-issues
- liferay-ga60-ce-743-known-issues
- liferay-ga61-ce-743-known-issues
- liferay-ga62-ce-743-known-issues
- liferay-ga63-ce-743-known-issues
- liferay-ga64-ce-743-known-issues
- liferay-ga65-ce-743-known-issues
- liferay-ga66-ce-743-known-issues
- liferay-ga67-ce-743-known-issues
- liferay-ga68-ce-743-known-issues
- liferay-ga69-ce-743-known-issues
- liferay-ga70-ce-743-known-issues
- liferay-ga71-ce-743-known-issues
- liferay-ga72-ce-743-known-issues
- liferay-ga73-ce-743-known-issues
- liferay-ga74-ce-743-known-issues
- liferay-ga75-ce-743-known-issues
- liferay-ga76-ce-743-known-issues
- liferay-ga77-ce-743-known-issues
- liferay-ga78-ce-743-known-issues
- liferay-ga79-ce-743-known-issues
- liferay-ga80-ce-743-known-issues
-
4
Description
Introduction
When defining a Web Content Structure, fields can be configured to be "Repeatable" - to allow the author to add multiple instances of the same field. The "Select" field ("Select from List" in 7.4) is often used this way - for example you might have a list of Countries, and want the user to select all that are applicable.
When this field type is defined in this way the way that this information is stored in the Search Index (Elasticsearch) is different to the same field type when it is not configured to be Repeatable, with the addition of extra "wrapping" characters. These additional characters are in turn displayed to the end-user incorrectly in the "Custom Facet" widget. Furthermore, while it is possible to correctly encode these characters to enable filtering on one value to work, this is not currently working in the product and therefore it renders filtering on these fields impossible.
Expected Behaviour
It should be possible to add a Custom Facet widget to a Search Page, configure it against the repeatable Select/Select from List field, and for end users to filter search results by one or more value.
Observed Behaviour
Multiple issues are observed:
- Stored values are wrapped in additional characters - for example, if the value presented to the content author is
Australia
then it will be stored in the Elasticsearch index as
[\"Australia\"]
- This value is rendered in the Custom Facet widget as
["Australia"]
- When the user attempts to filter the search by this value the URL that is generated fails to correctly URL encode the wrapping characters. An example of the URL that is generated is:
https://sales.liferay.com/en/group/library/mst?country=%5B
(This is correctly encoding the first open square bracket [ as %5B, but then failing to add the rest of the string) - If you manually construct the URL with correct encoding, Search is successful - e.g.:
https://sales.liferay.com/en/group/library/mst?country=%5B%22Aus%22%5D
correctly returns the right results.
Notes and further details
Two possible options seem to be available for resolution of this issue:
- Change the values that are stored in the Elasticsearch index to prevent the issue occurring in the first place
- Or - if there's a legitimate reason for the wrapping characters being present, modify the Custom Facet widget to (a) strip those characters from being displayed and (b) correctly URL encode the string so that search works as expected
An example search page with a simple structure that demonstrates this issue has been setup on Alexandria here. I can easily grant Admin access.
Samples of the Database entry for a record with these fields, as well as the Elasticsearch index for this entry are attached. Screenshots are also included.
While the examples used are from a 7.3 environment, the same problem is present in 7.4. In fact, because of LPS-146728 the problem is actually more pronounced.
Steps to Reproduce
- Add a new Web Content Structure
- Add a "Select" field to the structure, configure this field wit the "Repeatable" property set to "Yes".
- Add multiple options to the Select field.
- For example, add a field called "Country" and add multiple Countries as options - Australia, Spain, USA, Finland, Hungary
- As a "control", add a second Select field, with the "Repeatable" property set to "No".
- Add a web content article and add the repeatable field multiple times with different options.
- Create a custom search page which shows only results for this Web Content Structure (use the Custom Filter widget to filter by ddmStructureKey)
- Add a Custom Facet widget for each of the Select fields. You'll need to query to Elasticsearch index to find the field name using curl - e.g.:
curl "localhost:9201/_search?q=articleId:102161385&pretty=true" - Access the new page and attempt to filter on the Repeatable Select field.