PHP code example of mixailshaulsky / elasticsearch-bundle
1. Go to this page and download the library: Download mixailshaulsky/elasticsearch-bundle 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/ */
mixailshaulsky / elasticsearch-bundle example snippets
// src/Document/Product.php
namespace App\Document;
use ONGR\ElasticsearchBundle\Annotation as ES;
/**
* //alias and default parameters in the annotation are optional.
* @ES\Index(alias="products", default=true)
*/
class Product
{
/**
* @ES\Id()
*/
public $id;
/**
* @ES\Property(type="text", similarity="scripted_tfidf")
*/
public $title;
/**
* @ES\Property(type="float")
*/
public $price;
}