koloi — 2012-08-10T08:12:33-04:00 — #1
I am trying to customize my Mediawiki Seach in $server['PHPSELF']. I would like to ask your help. I use mediawiki 1.18, wamp server, mysql.
I can index page list like this.
$query = "select page_title from page where page_namespace = 0";
But i don't know how to make a query for search..
Thanks in advance
edgarzakaryan — 2012-08-15T06:00:16-04:00 — #2
Hi. Here is what you may use for search.
$search = $_REQUEST['search'];//just filter this data
$query = "select page_title from page where FIELD_NAME LIKE '%".$search."%' ";
wwb_99 — 2012-08-15T07:43:32-04:00 — #3
Don't do that -- you really should sanitize the input as well as use parameterized queries. Only you can prevent SQL injections.
As for free-text search queries, if you want to be effective over a large amount of source data you typically don't use SQL or at least use a full text engine within SQL. No idea what mediawiki's internal structures look like so I can't give more specific advice.
mittineague — 2014-09-20T03:06:00-04:00 — #4
This topic is now archived. It is frozen and cannot be changed in any way.