How to do searching with the full-text search

From semantic-mediawiki.org
Jump to: navigation, search
Full-text searchHow to do searching with the full-text search
Table of Contents

In addition to the regular combination of tildes (~) and asterisk (*) wildcards, as explained elsewhere on this wiki the full text search also offers some additional features and helps to overcome the native limitations of datatype "Text".

Examples

Annotation to a property called "Has text" of datatype "Text"1

... The principles of definition, the law of contradiction, the fallacy of arguing in a circle, the distinction between the essence and accidents of a thing or notion, between means and ends, between causes and conditions; also the division of the mind into the rational, concupiscent, and irascible elements, or of pleasures and desires into necessary and unnecessary --these and other great forms of thought are all of them to be found in the Republic, and were probably first invented by Plato. The greatest of all logical truths, and the one of which writers on philosophy are most apt to lose sight, the difference between words and things, has been most strenuously insisted on by him, although he has not always avoided the confusion of them in his own writings. ...

Phrase matching (both uppercase and lowercase)

Phrase matching is done by putting double quotes on either side of the phrase ("..."). This works for both uppercase and lowercase characters.

Query:

{{#ask:
 [[Has text::~"probably first invented by plato"]]
 |?Has text
}}

Result:

 Has text
How to do searching with the full-text search... The principles of definition, the law of contradiction, the fallacy of arguing in a circle, the distinction between the essence and accidents of a thing or notion, between means and ends, between causes and conditions; also the division of the mind into the rational, concupiscent, and irascible elements, or of pleasures and desires into necessary and unnecessary --these and other great forms of thought are all of them to be found in the Republic, and were probably first invented by Plato. The greatest of all logical truths, and the one of which writers on philosophy are most apt to lose sight, the difference between words and things, has been most strenuously insisted on by him, although he has not always avoided the confusion of them in his own writings. ...
NoteNote: There is a difference between Plato (with an uppercase initial) in the original text and plato (as part of the query string).

Approximate matching within long texts

If the property is unknown, use two tildes (~~) instead of one:

Query:

{{#ask:
 [[~~probably first invented by Plato]]
 |format=broadtable
 |link=all
 |headers=show
}}

Result:

 
How to do searching with the full-text search

Wide proximity

Broad text search tries to match a string text without a specific property to broaden possible result matches. To initiate a fulltext match search specific an additional ~ will indicate to the QueryEngine to use the fulltext index.

  • [[!~~ first invented by Plato]] to be translated into the SQL-query (MATCH(t0.o_text) AGAINST ('-first invented by plato' IN BOOLEAN MODE) )
  • [[~~ first invented by Plato]] to be translated into the SQL-query (MATCH(t0.o_text) AGAINST ('first invented by plato' IN BOOLEAN MODE) )

More examples