SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Query selection for search engine?

    I am trying to customize my Mediawiki Seach in $_server['PHP_SELF']. I would like to ask your help. I use mediawiki 1.18, wamp server, mysql.
    I can index page list like this.
    PHP Code:
    $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

  2. #2
    SitePoint Enthusiast edgarzakaryan's Avatar
    Join Date
    Aug 2012
    Location
    Yerevan, Armenia
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by koloi View Post
    I am trying to customize my Mediawiki Seach in $_server['PHP_SELF']. I would like to ask your help. I use mediawiki 1.18, wamp server, mysql.
    I can index page list like this.
    PHP Code:
    $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

    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."%' ";

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •