Skip to content

Conversation

@adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Apr 19, 2022

Question Answer
JIRA Ticket N/A
Versions 4.1 at least, could be all versions

The permalink character is extracted and indexed by the crawler.
Actually, it is shown in search results on https://doc.ibexa.co/en/4.1/ while not shown on https://doc.ibexa.co/en/3.3/ which is still an enigma to me while opening this PR.

To ensure that it's always removed when displaying search results, it can be done while building the dropdown using DocSearch v2's transformData feature.

The permalink character `¶` is extracted and indexed by the crawler. To ensure that it always removed when displaying search results, it can be done with `docsearch` `transformData`

https://docsearch.algolia.com/docs/legacy/behavior/#transformdata
$.each(hits, function(index, hit) {
for (lvl=2; lvl<=3; lvl++) {
if (null !== hit.hierarchy['lvl'+lvl]) {
hits[index].hierarchy['lvl' + lvl] = hit.hierarchy['lvl' + lvl].replace(/[.]/g, '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find where this is used. _highlightResult.hierarchy is the one used to build the dropdown result menu.

@adriendupuis adriendupuis requested a review from damianz5 April 19, 2022 10:40
@adriendupuis
Copy link
Contributor Author

Some examples to test:

  • lvl2: "Create new User setting¶"
  • lvl3: "Let's Connect!¶"
  • lvl4: "New Options in the Rich Text editor¶"
  • lvl5: "Solr 7¶"
  • lvl6: "Content-Type header¶"

@adriendupuis adriendupuis merged commit 23f5bf2 into master Apr 19, 2022
@adriendupuis adriendupuis deleted the fix/search-result branch April 19, 2022 15:10
adriendupuis added a commit that referenced this pull request Apr 19, 2022
adriendupuis added a commit that referenced this pull request Apr 19, 2022
adriendupuis added a commit that referenced this pull request Apr 19, 2022
adriendupuis added a commit that referenced this pull request Apr 19, 2022
@adriendupuis
Copy link
Contributor Author

Cherry-picked to 4.1, 4.0, 3.3, 2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants