« Issue/1481 (Fulltext)/Text examples » : différence entre les versions

De Semantic MediaWiki - Sandbox
(Page créée avec « == Term include and exclude == Using <code>-</code> or <code>!~</code> requires at least two terms in order for the fulltext to match a result. (see also [https://dev.mys... »)
 
(https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1762)
 
(Une version intermédiaire par le même utilisateur non affichée)
Ligne 9 : Ligne 9 :
</pre>
</pre>
{{#ask: [[Category:Fulltext example]] [[Has text::~+MariaDB -database]]
{{#ask: [[Category:Fulltext example]] [[Has text::~+MariaDB -database]]
|?Has text
}}
<pre>
{{#ask: [[Category:Fulltext example]] [[Has text::~+*maria* -postgres*]]
|?Has text
}}
</pre>
{{#ask: [[Category:Fulltext example]] [[Has text::~+*maria* -postgres*]]
  |?Has text
  |?Has text
}}
}}

Dernière version du 7 août 2016 à 22:22

Term include and exclude

Using - or !~ requires at least two terms in order for the fulltext to match a result. (see also Boolean Full-Text Searches)

{{#ask: [[Category:Fulltext example]] [[Has text::~+MariaDB -database]]
 |?Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesMariaDB overview
{{#ask: [[Category:Fulltext example]] [[Has text::~+*maria* -postgres*]]
 |?Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMariaDB overview
{{#ask: [[Category:Fulltext example]] [[Has text::~+database]]
 |?Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
Issue/1481 (Fulltext)/Text examplesPostgreSQL vs MariaDB database and more of

With/without query expansion

Describes as "...'MariaDB' is always associated with the word 'database', so it is returned when query expansion is used, even though not explicitly requested...." https://mariadb.com/kb/en/mariadb/fulltext-index-overview/

{{#ask: [[Category:Fulltext example]] [[Has text::~database]]
 |?Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
Issue/1481 (Fulltext)/Text examplesPostgreSQL vs MariaDB database and more of

&QEX indicates to switch to the WITH QUERY EXPANSION mode.

{{#ask: [[Category:Fulltext example]] [[Has text::~database&QEX]]
 |?Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
Issue/1481 (Fulltext)/Text examplesPostgreSQL vs MariaDB database and more of

Partial term matching

Case insensitive

{{#ask: [[Category:Fulltext example]] [[Has text::~mariadb]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesPostgreSQL vs MariaDB database and more of
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMariaDB overview

Case insensitive with wildcard

{{#ask: [[Category:Fulltext example]] [[Has text::~DATA*]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesPostgreSQL vs MariaDB database and more of
Issue/1481 (Fulltext)/Text examplesOracle vs MariaDB database
Issue/1481 (Fulltext)/Text examplesMySQL vs MariaDB database
{{#ask: [[Category:Fulltext example]] [[Has text::~sEAr*]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesElastic search
Issue/1481 (Fulltext)/Text examplesSphinx search

Wildcard include, exclude term match

{{#ask: [[Category:Fulltext example]] [[Has text::~sear*, -elas*]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesSphinx search
{{#ask:[[Category:Fulltext example]] [[Has text::!~elastic*, +sear*]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesSphinx search

Phrase matching

{{#ask: [[Category:Fulltext example]] [[Has text::~"life is no longer life"]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesI will tell you, Socrates, he said, what my own feeling is. Men of my age flock together; we are birds of a feather, as the old proverb says; and at our meetings the tale of my acquaintance commonly is --I cannot eat, I cannot drink; the pleasures of youth and love are fled away: there was a good time once, but now that is gone, and life is no longer life. Some complain ...

Minimum token size

The search term does not fullfill the $smwgFulltextSearchMinTokenSize hence the query switches to the LIKE expression instead of using the fulltext index.

{{#ask: [[Category:Fulltext example]] [[Has text::~Tr*]]
 |?Has text
 |sort=Has text
}}
 Has text
Issue/1481 (Fulltext)/Text examplesTransactions
Issue/1481 (Fulltext)/Text examplesTriggers

Example data

{{#subobject:
 |@category=Fulltext example
 |Has text=MySQL vs MariaDB database
}}{{#subobject:
 |@category=Fulltext example
 |Has text=Oracle vs MariaDB database
}}{{#subobject:
 |@category=Fulltext example
 |Has text=PostgreSQL vs MariaDB database and more of
}}{{#subobject:
 |@category=Fulltext example
 |Has text=MariaDB overview
}}{{#subobject:
 |@category=Fulltext example
 |Has text=Elastic search
}}{{#subobject:
 |@category=Fulltext example
 |Has text=Sphinx search
}}{{#subobject:
 |@category=Fulltext example
 |Has text=Transactions
}}{{#subobject:
 |@category=Fulltext example
 |Has text=Triggers
}}{{#subobject:
 |@category=Fulltext example
 |Has text=I will tell you, Socrates, he said, what my own feeling is. Men of my age flock together; we are birds of a feather, as the old proverb says; and at our meetings the tale of my acquaintance commonly is --I cannot eat, I cannot drink; the pleasures of youth and love are fled away: there was a good time once, but now that is gone, and life is no longer life. Some complain ...
}}
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.