« Issue/1481 (Fulltext)/Text examples » : différence entre les versions
m (Mwjames a déplacé la page Issue/1481 (Fulltext)/Text examples vers Issue/1481 (Fulltext)/Text examples) |
(https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1762) |
||
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 }}
{{#ask: Has text::~+MariaDB -database
|?Has text
}}
{{#ask: [[Category:Fulltext example]] [[Has text::~+*maria* -postgres*]] |?Has text }}
{{#ask: Has text::~+*maria* -postgres*
|?Has text
}}
{{#ask: [[Category:Fulltext example]] [[Has text::~+database]] |?Has text }}
{{#ask: Has text::~+database
|?Has text
}}
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 }}
{{#ask: Has text::~database
|?Has text
}}
&QEX
indicates to switch to the WITH QUERY EXPANSION
mode.
{{#ask: [[Category:Fulltext example]] [[Has text::~database&QEX]] |?Has text }}
{{#ask: Has text::~database&QEX
|?Has text
}}
Partial term matching
Case insensitive
{{#ask: [[Category:Fulltext example]] [[Has text::~mariadb]] |?Has text |sort=Has text }}
{{#ask: Has text::~mariadb
|?Has text |sort=Has text |order=desc
}}
Case insensitive with wildcard
{{#ask: [[Category:Fulltext example]] [[Has text::~DATA*]] |?Has text |sort=Has text }}
{{#ask: Has text::~DATA*
|?Has text |sort=Has text |order=desc
}}
{{#ask: [[Category:Fulltext example]] [[Has text::~sEAr*]] |?Has text |sort=Has text }}
{{#ask: Has text::~sEAr*
|?Has text |sort=Has text
}}
Wildcard include, exclude term match
{{#ask: [[Category:Fulltext example]] [[Has text::~sear*, -elas*]] |?Has text |sort=Has text }}
{{#ask: Has text::~sear*, -elas*
|?Has text |sort=Has text
}}
{{#ask:[[Category:Fulltext example]] [[Has text::!~elastic*, +sear*]] |?Has text |sort=Has text }}
{{#ask: Has text::!~elastic*, +sear*
|?Has text |sort=Has text
}}
Phrase matching
{{#ask: [[Category:Fulltext example]] [[Has text::~"life is no longer life"]] |?Has text |sort=Has text }}
{{#ask: Has text::~"life is no longer life"
|?Has text |sort=Has text
}}
Minimum token size
The search term does not fullfill the [[Help::$smwgFulltextSearchMinTokenSize|$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 }}
{{#ask: Has text::~Tr*
|?Has text |sort=Has text
}}
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 ... }}
{{#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 ...
}}