Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Also search custom_field for search term
Maybe I am missing something but I could not quite find an answer to that. I know how it is possible to display only articles with a certain value on a certain custom_field but what I want is:
The normal search should not only look in title, body and excerpt for the search term it should also look in the custom_field. Is that achievable without a plugin or would I need to use etc_search for that?
Offline
Re: Also search custom_field for search term
You need wet_haystack but I’m not sure if it still works in the later versions of txp.
Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.
Offline
Re: Also search custom_field for search term
I believe wet_haystack does still work, and if it doesn’t all you need from it is the two SQL queries it executes. wet_haystack simply adds further columns to the database table’s FULLTEXT index and then stays out of the way until you decide to add or remove another column to the index. It essentially does:
ALTER TABLE textpattern DROP INDEX searching
and then:
ALTER TABLE textpattern ADD FULLTEXT searching(Title, Body, custom_1);
or another column name in place of custom_1
depending on what content you want to be searchable in search operations. (wet_haystack uses wet_haystack
as the index name rather than searching
as set during textpattern installation).
TXP Builders – finely-crafted code, design and txp
Offline
Re: Also search custom_field for search term
Thank you both. I can confirm that wet_haystack works perfectly fine. It looks a bit 4.2+ish though =)
And good to know that in case it ever stops working how to achieve the same thing.
Offline