S
S
Sergei2015-11-24 20:22:47
MediaWiki
Sergei, 2015-11-24 20:22:47

How to exclude non-existent pages in mediawiki?

Good afternoon. I use it to search the sphinx wiki, but it's not really that important. The query to build an index looks like this:

sql_query	= SELECT page_id, page_len, page_title, page_namespace, page_is_redirect, old_id, old_text, 'wiki' AS source FROM page, revision, text
 WHERE rev_id=page_latest AND old_id=rev_text_id AND page_is_redirect = 0 AND page_len>0 
 AND rev_len>0

I took the basis of the request from the settings of SphinxSearch ,
but as a result I get some of the pages that are in the database and are not available from the wiki. most likely deleted (I don't manage the content of the wiki) They display a typical error for non-existent pages:
There is currently no text on this page. You can find references to this name in other articles, find related journal entries, or create a page with that name.

I read a bunch of everything on media wikis, tried to find some significant differences by selecting the id of an existing page and a non-existing page - I did not find anything. I did not try to understand the logic of loading pages by code - I felt sorry for myself ... How to solve this problem? Ideally, if possible, then throw a request that will pull out only existing pages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-26
@Neversmille

The solution to the problem is to add to the links generated by the search results the string names corresponding to the page_namespace from the page table.
Those. Category: , Special: etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question