This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\AcmeBundle\Dbal; | |
use Doctrine\DBAL\Types\Type; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
class TsvectorType extends Type | |
{ | |
public function getName() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Index config | |
{ | |
"number_of_shards": 5, | |
"number_of_replicas": 1, | |
"analysis": { | |
"analyzer": { | |
"log_analyzer": { | |
"type": "custom", | |
"tokenizer": "pattern", | |
"filter": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create index with mapping | |
curl -XPUT http://192.168.0.10:9200/geotest/ -d '{ | |
"settings" : { | |
"number_of_shards" : 1 | |
}, | |
"mappings" : { | |
"places" : { | |
"properties" : { | |
"name" : { "type" : "string" }, | |
"location" : { "type" : "geo_point", "lat_lon": true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function json_encode_pretty($obj, $indentation = 0) | |
{ | |
switch (gettype($obj)) | |
{ | |
case 'object': | |
$obj = get_object_vars($obj); | |
case 'array': | |
if (!isset($obj[0])) |
NewerOlder