Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CloudSearch nanapi use case

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for violetyk violetyk
October 17, 2014

CloudSearch nanapi use case

Avatar for violetyk

violetyk

October 17, 2014
Tweet

More Decks by violetyk

Other Decks in Technology

Transcript

  1. CakePHP + CloudSearch • CakePHP͔ΒCloudSearchΛૢ࡞͢ΔϓϥάΠϯ • https://github.com/nanapi/cakephp-cloud-search • AWS SDK

    for PHPΛϥοϓͨ͠Datasource • CakePHPͷModelͱͯ͠ѻ͏͜ͱ͕Ͱ͖Δ • Modelͱಉ͡ϝιουɺfind() / save()
  2. อଘ // save $save_data = $this->MyModel->create(); $save_data = [ 'id'

    => '123', 'fields' => [ 'subject' => 'ژ౎Ͱͷ͓͢͢Ίͷ͓౔࢈' 'outline' => ['ژ౎ͷ͓౔࢈', '࣮ࡍʹങͬͨ͜ͱͷ͋Δ͓౔࢈', 'ژ౎ͷ͓౔࢈ʹ͍ͭͯ ͷΞυόΠε'] ] ]; $this->MyModel->save($save_data);
  3. ݕࡧ // find $result = $this->MyModel->find('all', [ 'conditions' => [

    'query' => 'ژ౎' ], 'fields' => [ 'id', 'subject', '_score' ] ]);