Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does full-text search inside titles return error

When I perform full-text search with Wikipedia API, I can not narrow it to titles only (srwhat=title).

So while search anywhere (default) http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=sql&srnamespace=14&format=xml

returns results, if I add srwhat=title, I got an error:

<api servedby="mw69">
  <error code="srsearch-title-disabled" info="title search is disabled"/>
</api>

This error is even listed in the docs ( http://www.mediawiki.org/wiki/API:Search ), but without any explanation.

like image 309
Maksee Avatar asked Jan 15 '13 11:01

Maksee


People also ask

How do you do a full-text search?

To implement a full-text search in a SQL database, you must create a full-text index on each column you want to be indexed. In MySQL, this would be done with the FULLTEXT keyword. Then you will be able to query the database using MATCH and AGAINST.

How do I know if full-text search is enabled?

A: You can determine if Full-Text Search is installed by querying the FULLTEXTSERVICEPROPERTY like you can see in the following query. If the query returns 1 then Full-Text Search is enabled.

How does full-text search work in SQL Server?

If a SQL query includes a full-text search query, the query is sent to the Full-Text Engine, both during compilation and during execution. The query result is matched against the full-text index. Full-Text Engine. The Full-Text Engine in SQL Server is fully integrated with the query processor.


2 Answers

Actually, there is a way to workaround this, just add intitle: prefix to your search term:

srsearch=intitle:sql

You can find an explanation here: https://en.wikipedia.org/wiki/Help:Searching#Parameters

like image 61
Damian Pavlica Avatar answered Oct 11 '22 12:10

Damian Pavlica


It means that the search engine Wikipedia uses (Lucene, I believe) does not support title search.

like image 21
svick Avatar answered Oct 11 '22 12:10

svick