// Add the constraint to the Options object $options3->setReturnSimilar('true'); // Return similar documents $options3->write('options3'); // Write the search options to the database // Read the options from the database and display echo "Word constraint and a search-option:\n\n"; echo htmlspecialchars($options3->read('options3')); // Field word constraint $options4 = new MLPHP\Options($client); // Create an Options object (passing the REST client object) $field = new MLPHP\FieldWordConstraint('summary', 'summary'); // Set field namespace $options4->addConstraint($field); // Add the constraint to the Options object $options4->setDebug('true'); // Return debugging info $options4->write('options4'); // Write the search options to the database // Read the options from the database and display echo "Field word constraint:\n\n"; echo htmlspecialchars($options4->read('options4')); echo "\n\n"; // Collection constraint with metadata $options5 = new MLPHP\Options($client); // Create an Options object (passing the REST client object) $collection = new MLPHP\CollectionConstraint('tag', 'http://example.com/tag/'); // Set prefix $options5->addConstraint($collection); // Add the constraint to the Options object $extracts5 = new MLPHP\Extracts();