Skip to content

Instantly share code, notes, and snippets.

@ruflin
ruflin / gist:1146118
Created August 15, 2011 12:16
Set invalid settings
curl -XDELETE 'http://localhost:9200/test/test/1'
curl -XPUT 'http://localhost:9200/test/test/1' -d '{}'
curl -XPUT 'localhost:9200/test/_settings' -d '{"index":{"merge.policy.expunge_deletes_allowed":25}}'
curl -XPOST 'localhost:9200/test/_close'
curl -XPUT 'localhost:9200/test/_settings' -d '{"index":{"merge.policy.hello_world":15}}'
curl -XPOST 'localhost:9200/test/_open'
curl -XGET 'localhost:9200/test/_settings?pretty=true'
@ruflin
ruflin / Xodoa_Helper::toUrl
Created April 29, 2011 15:53
Convert string to url string
/**
* Transforms a string to a valid url parameter
*
* @param string $string String to transform to valid url
* @param int $limit Max length of return string. Default is 255, because url shouldn't be longer
* @return string
*/
public static function toUrl($string, $limit = 255) {
$string = self::toAscii($string, true);
$string = str_replace('.', '-', $string);