PHP code example of tomwalder / php-appengine-search
1. Go to this page and download the library: Download tomwalder/php-appengine-search library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tomwalder / php-appengine-search example snippets
// Schema describing a book
$obj_schema = (new \Search\Schema())
->addText('title')
->addText('author')
->addAtom('isbn')
->addNumber('price');
// Create and populate a document
$obj_book = $obj_schema->createDocument([
'title' => 'The Merchant of Venice',
'author' => 'William Shakespeare',
'isbn' => '1840224312',
'price' => 11.99
]);
// Write it to the Index
$obj_index = new \Search\Index('library');
$obj_index->put($obj_book);