LoginSignup
1
1

More than 5 years have passed since last update.

PHPからGroongaを利用する - GSelectクラス

Last updated at Posted at 2014-12-01

GSelectクラス

PHP bindings for Groonga.

GSelect {
  /* メソッド */
  public void __construct(GTable object)
  public void __destruct(void)
  public GSelect matchColumns(string value)
  public GSelect query(string value)
  public GSelect filter(string value)
  public GSelect scorer(string value)
  public GSelect sortby(string value)
  public GSelect outputColumns(string value)
  public GSelect offset(string value)
  public GSelect limit(string value)
  public GSelect drilldown(string value)
  public GSelect drilldownSortby(string value)
  public GSelect drilldownOutputColumns(string value)
  public GSelect drilldownOffset(string value)
  public GSelect drilldownLimit(string value)
  public GSelect cache(string value)
  public GSelect matchEscalationThreshold(string value)
  public GSelect queryExpansion(string value)
  public GSelect queryFlags(string value)
  public GSelect queryExpander(string value)
  public GSelect adjuster(string value)
  public GSelect exec(void)
}

コンストラクタ GSelect::__construct

クラスの生成

$delete = new GSelect(gtable);

引数

名前 概要
object GTable GTableオブジェクト

戻り値

なし

$gdb = new Groonga('./db/test.db');

$talbe = $gdb->table('Users');
$select = $talbe->select();
print_r($select);

結果

GSelect Object
(
)

変数の設定 GSelect::***(string value)

$select->matchColumns('')
       ->query('')
       ->filter('')
       ->scorer('')
       ->sortby('')
       ->outputColumns('_id, _key, *')
       ->offset('0')
       ->limit('0')
       ->drilldown('')
       ->drilldownSortby('')
       ->drilldownOutputColumns('_key, _nsubrecs')
       ->drilldownOffset('0')
       ->drilldownLimit('10')
       ->cache('')
       ->matchEscalationThreshold('0')
       ->queryExpansion('')
       ->queryFlags('ALLOW_PRAGMA|ALLOW_COLUMN|ALLOW_UPDATE|ALLOW_LEADING_NOT|NONE')
       ->queryExpander('')
       ->adjuster('')

引数

名前 概要
value string 設定値

戻り値

失敗した場合false
成功時GSelectオブジェクト

$gdb = new Groonga('./db/test.db');

/* select --table Users --limit 5 */
$table = $gdb->table('Users');
$table->select()->limit(5)->exec();

実行 GSelect::exec

select処理の実行

$select->exec();

戻り値

失敗した場合false
成功時GSelectオブジェクト

$gdb = new Groonga('./db/test.db');

/* select --table Users --offset 1 */
$table = $gdb->table('Users');
$table->select()->offset(1)->exec();

PHPからGroongaを利用する-Groongaクラス
PHPからGroongaを利用する-GCommandクラス
PHPからGroongaを利用する-GTableクラス
PHPからGroongaを利用する-GColumnクラス
PHPからGroongaを利用する-GLoadクラス
PHPからGroongaを利用する-GDeleteクラス
PHPからGroongaを利用する-GSelectクラス

PHPからGroongaを利用する-PHPバインディング

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1