You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
edit the first text content element again and append "Lorem ipsum dolor sit amet." (so that it says "Lorem ipsum. Lorem ipsum dolor sit amet.") and save
there will only be one search result now, as expected
Cause
\Contao\Search::indexPage searches for existing entries here, using the checksum of the page's content, and then either creates a new entry or updates the existing one.
$objIndex = $objDatabase->prepare("SELECT id, url FROM tl_search WHERE checksum=? AND pid=?")
->limit(1)
->execute($arrSet['checksum'], $arrSet['pid']);
// Add the page to the tl_search tableif ($objIndex->numRows)
{
// update existing entry …
}
else
{
// create new entry …
}
However, since the content has changed, the checksum is different of course, thus after an edit of a page, there will always be a new entry in tl_search - which leads to multiple search results for the same page.
Fix?
Shouldn't old entries with the same url simply be deleted or updated, instead of searching for the checksum? Under what circumstances would an entry get updated with new values? If the page has changed, the checksum will be different. If a page did not change, there is nothing to be updated in the first place, I assume.
The text was updated successfully, but these errors were encountered:
### 4.2.3 (2016-09-06)
* Do not double URL encode the content syndication links.
* Use CSS3 transforms instead of transitions to animate the off-canvas navigation.
* Improve the exception handling when using the resource locator (see #557).
* Correctly reset the filter menu in parent view.
* Support all characters but =!<> and whitespace in simple tokens (see contao/core#8436).
* Check the user's permission when generating links in the picker (see contao/core#8407).
* Handle forward pages without target in the navigation modules (see contao/core#8377).
* Provide the same template variables for downloads and enclosures (see contao/core#8392).
* Handle %n when parsing date formats (see contao/core#8411).
* Fix the module wizard's accessibility (see contao/core#8391).
* Correctly initialize TinyMCE in sub-palettes in Firefox (see contao/core#3673).
* Validate form field names more accurately (see contao/core#8403).
* Correctly show the ctime, mtime and atime of a folder (see contao/core#8408).
* Correctly index changed pages (see contao/core#8439).
Side note: this problem still exists, if you change the content of a page and then open it in the frontend under a different URL (e.g. example.org/ vs example.org/index.html, see also #8460). Though I guess technically that works as expected since a different URL means different content as well (from a client's perspective).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Reproduction
The first result will have [100% relevance] and shows the most recent edit:
The second result will have [50% relevance] and shows the initial edit:
Cause
\Contao\Search::indexPagesearches for existing entries here, using the checksum of the page's content, and then either creates a new entry or updates the existing one.However, since the content has changed, the checksum is different of course, thus after an edit of a page, there will always be a new entry in
tl_search- which leads to multiple search results for the same page.Fix?
Shouldn't old entries with the same
urlsimply be deleted or updated, instead of searching for the checksum? Under what circumstances would an entry get updated with new values? If the page has changed, the checksum will be different. If a page did not change, there is nothing to be updated in the first place, I assume.The text was updated successfully, but these errors were encountered: