Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Sort by txp:search_result_excerpt count
Search results in Textpattern are rendered (and sorted) by txp:article
. How to sort results by density of the queried keywords? The flexible layout usually would look more consistent and logical: az.on.lt/?q=pirm.
Offline
Re: Sort by txp:search_result_excerpt count
It actually does sort them by relevancy, but MySQL MATCH ... AGAINST
construction used as score works rather unpredictably in my tests.
Offline
Re: Sort by txp:search_result_excerpt count
Yeah, unsure how to fix this. From memory, it should default to sort="score desc"
(or score asc
??) for search results, but that may be wishful thinking. If not, does setting that manually in your search result article make any difference?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Sort by txp:search_result_excerpt count
Bloke wrote #319707:
it should default to
sort="score desc"
(orscore asc
??) for search results, but that may be wishful thinking. If not, does setting that manually in your search result article make any difference?
Tried — with no difference…
Offline
Re: Sort by txp:search_result_excerpt count
This could work (unsure about the performance):
sort='CHAR_LENGTH(Body) - CHAR_LENGTH( REPLACE ( Body, "<txp:search_term />", "") ) DESC'
Offline