Subject: How to Customize Search?

Posted on: 06/12/2017 10:45am
By: Anonymous

I have an issue with search function. Some of the keywords visitors frequently input are words used in some pages. Those pages are type of neither "stories","comments","events","links" nor "staticpages" so that seaching end up with no results.
How can I customize functions or include "all pages" for gl in-site search?

Re: How to Customize Search?

Posted on: 06/12/2017 11:15am
By: Laugh

What are the pages generated from? The search function only works with items that you mention along with any plugins that support it (most do).


Re: How to Customize Search?

Posted on: 06/12/2017 11:35am
By: Anonymous

Thanks for your quick reply, Laugh.

Those pages are one of main pages, but considering the search and results, those pages are generated by a custom php function.Urls for them are like "domainname/index.php?some-unique-parameters".

I'd like to know whether it's possible to customize seach.php function or not. Where are they?Are those written by simple PHP?

Re: How to Customize Search?

Posted on: 06/12/2017 12:56pm
By: Laugh

Yes you can write a custom search function called "CUSTOM_dopluginsearch"

It has to be called and return the search results in a certain way.

See the file /system/lib-plugins.php and PLG_doSearch function for an idea of what to do.

I would also check out the links plugin function.inc file for the function plugin_dopluginsearch_links

It has a more simply search function which you may be able to base your new CUSTOM_dopluginsearch function on.

Re: How to Customize Search?

Posted on: 06/12/2017 01:34pm
By: Anonymous

Thank you.
I'll check it out.
I have another idea that reads a csv file and merge it with results from search.php but that method is not simple because I have to update the csv.file every time people create a new page of the kind. So I'll try the way you informed first.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=96654