Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Blank search results
How to avoid many blank search results in my etymological dictionary?
An internal browser’s Ctrl-F search usually does not distinguishes diacritical from plain latin letters, finds and highlights all of them. That is OK, Textpattern also collects all the matching pages, but shows inexact excerpts as blank. For an example, there is only one page with dūš, although also many pages with dus
.
How to exclude inexact results or at least cite them, too?
Offline
Re: Blank search results
A tough one. You can try to change collations of Title
and Body(_html?)
in textpattern
table to utf8mb4_bin
or something language-specific, but there is no guarantee. Backup, for sure.
Offline
Re: Blank search results
Risked the change. And reverted back, in case of no difference between utf8mb4_bin and utf8mb4_lithuanian_ci.
Offline
Re: Blank search results
I have tried, but MySQL does not let me change Body
collation because of FULLTEXT index.
A poor man solution might be hiding ‘parasite’ matches:
<txp:evaluate test="search_result_excerpt">
...
<txp:search_result_excerpt />
...
</txp:evaluate>
Offline
Re: Blank search results
Good catch, thanks Oleg, that should work. I still have not adjusted tags correctly, though — that is all I have been able to do:
<txp:article> <txp:evaluate test="search_result_excerpt">
<section><txp:permlink>
<h3><txp:section title />: <txp:title /></h3>
<p><txp:search_result_excerpt /></p>
</txp:permlink></section>
</txp:evaluate> </txp:article>
Unfortunately, no articles are shown now in the search results.
Offline
Re: Blank search results
Tests are done only one-level depth, so it could be (untested though)
<txp:article>
<txp:permlink evaluate="search_result_excerpt" wraptag="section">
<h3><txp:section title />: <txp:title /></h3>
<p><txp:search_result_excerpt /></p>
</txp:permlink>
</txp:article>
Edit: otherwise,
SELECT 'dūš' LIKE 'dus' COLLATE utf8mb4_bin
returns 0 for me, unlike
SELECT 'dūš' LIKE 'dus'
So, if you manage to change Body
collation to utf8mb4_bin
(or something else without _ci
suffix, i.e. not case-insensitive), that could work.
Offline
Re: Blank search results
Bingo! Your txp:tag_fu beats every ghost and fake news now, thanx!
Offline
Re: Blank search results
Oops, the ghosts are still live, although they are hidden from our readers as an empty <a rel="bookmark" href="https://domain.tld/titile"></a>
now.
Last edited by Vienuolis (2021-05-10 18:32:10)
Offline
Re: Blank search results
Vienuolis wrote #330100:
Oops, the ghosts are still live, although they are hidden from our readers as an empty
<a rel="bookmark" href="https://domain.tld/titile"></a>
now.
Damn! Ok, this will be for 4.8.6. Meanwhile,
<txp:article>
<txp:permlink wraptag="section"><txp:evaluate test="search_result_excerpt">
<h3><txp:section title />: <txp:title /></h3>
<p><txp:search_result_excerpt /></p>
</txp:evaluate></txp:permlink>
</txp:article>
Offline
Pages: 1