Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • AdvancedSearchForm
  • ContentControllerSearchExtension
  • EndsWithFilter
  • ExactMatchFilter
  • ExactMatchMultiFilter
  • FulltextFilter
  • FulltextSearchable
  • GreaterThanFilter
  • LessThanFilter
  • NegationFilter
  • PartialMatchFilter
  • SearchContext
  • SearchFilter
  • SearchForm
  • StartsWithFilter
  • StartsWithMultiFilter
  • SubstringFilter
  • WithinRangeFilter
 1 <?php
 2 /**
 3  * @package sapphire
 4  * @subpackage search
 5  */
 6 
 7 /**
 8  * Filters by full-text matching on the given field.
 9  *
10  * Full-text indexes are only available with MyISAM tables. The following column types are
11  * supported:
12  *   - Char
13  *   - Varchar
14  *   - Text
15  *
16  * To enable full-text matching on fields, you also need to add an index to the
17  * database table, using the {$indexes} hash in your DataObject subclass:
18  * 
19  * <code>
20  *   static $indexes = array(
21  *      'SearchFields' => 'fulltext(Name, Title, Description)'
22  *   );
23  * </code>
24  *
25  * @package sapphire
26  * @subpackage search
27  */
28 class FulltextFilter extends SearchFilter {
29 
30     public function apply(SQLQuery $query) {
31         $query->where(sprintf(
32             "MATCH (%s) AGAINST ('%s')",
33             $this->getDbName(),
34             Convert::raw2sql($this->getValue())
35         ));
36         return $query;
37     }
38 
39     public function isEmpty() {
40         return $this->getValue() == null || $this->getValue() == '';
41     }
42 }
43 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0