This file contains 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
Cluster Health: | |
{ | |
"cluster_name" : "es_cluster_dev", | |
"status" : "yellow", | |
"timed_out" : false, | |
"number_of_nodes" : 1, | |
"number_of_data_nodes" : 1, | |
"active_primary_shards" : 15, | |
"active_shards" : 15, | |
"relocating_shards" : 0, |
This file contains 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
#word histogram query - docs for separate ids in separate types | |
curl -XGET "${SERVER}/pd-0/${ID}/_search?pretty" \ | |
-d '{ | |
"size" : 0, | |
"query" : { "match_all" : { } }, | |
"facets" : { | |
"q1" : { | |
"terms" : { | |
"field" : "q1", | |
"size" : 100 |
This file contains 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
SERVER="http://localhost:9200" | |
curl -XPUT "$SERVER/bugs/page/8872248-p-145" -d '{"id":145,"url":"http://alexsandbox.wordpress.com/header-test/","date":"2010-02-06 05:23:27","date_gmt":"2010-02-06 05:23:27","author":"Alex Mills","author_login":"viper007bond","title":"Header Test","content":"asdfasd as sad f","category":"Uncategorized","meta":{"_edit_lock":["1337928058:50392"],"_edit_last":["50392"],"_thumbnail_id":["147"]},"meta_raw":{"_edit_lock":["1337928058:50392"],"_edit_last":["50392"],"_thumbnail_id":["147"]}}' | |
curl -XGET "$SERVER/bugs/_search?pretty" -d ' | |
{ | |
"query":{"filtered":{"query":{"multi_match":{"query":"automattic","fields":["title","content"]}},"filter":{"match_all":{}}}}, | |
"facets" : { | |
"tag" : { | |
"terms" : { |
This file contains 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: wpes-mgs-p2.css | |
=================================================================== | |
--- wpes-mgs-p2.css (revision 53507) | |
+++ wpes-mgs-p2.css (working copy) | |
@@ -13,7 +13,6 @@ | |
div#wpes-p2-header { | |
border-bottom: 1px solid #ccc; | |
- padding: 20px 30px; | |
} |
This file contains 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
{ | |
"took": 3, | |
"timed_out": false, | |
"_shards": { | |
"total": 2, | |
"successful": 2, | |
"failed": 0 | |
}, | |
"hits": { | |
"total": 422, |
This file contains 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
//if we can't tell the lang with 5000 characters we probably can't tell the language | |
$text = mb_substr( $text, 0, 5000 ); | |
//replace non-breaking spaces so they don't match the \p{L} char class | |
$text = preg_replace( '/[\x{00A0}\x{2007}\x{202F}]/u', ' ', $text ); | |
//replace unicode symbols: see: http://www.utf8-chartable.de/unicode-utf8-table.pl | |
$text = preg_replace( '/[\x{2000}-\x{2BFF}]/u', ' ', $text ); //symbols | |
$text = preg_replace( '/[\x{1f000}-\x{1ffff}]/u', ' ', $text ); //symbols, emoticons |
This file contains 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 | |
/** | |
* VIPs need some special vetting as they can have custom code in the functions.php | |
* to setup custom taxonomies / post types and the like. | |
* | |
* We need to load the functions.php file for these themes. | |
* | |
* An other problem is that things which are usually attached to early hooks such as init or after_theme_setup | |
* in order to register custom taxonomies or post types are not working as the init hook already fired off when the jobs action is executed. | |
* So we copy all functions attached to the hooks we need ( currently after_theme_setup, init ) to an other hook and fire it off |
This file contains 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
Մեր հÕ րևÕ Õ բÕ կում երկու եղբÕ յր Õ Õ Õ Õ պրում ՄÕ օր եղբÕ յրÕ երը որոÕ եցÕ Õ բÕ րձրÕ Õ Õ լ Õ րեÕ ց Õ Õ Õ Õ Õ Õ Õ քը ՔÕ Õ եցÕ Õ բերեցÕ Õ ծÕ Õ ր սÕ Õ դուղքը ու բÕ րձրÕ ցÕ Õ մութ Õ Õ Õ Õ քը Փոքր եղբÕ յրը Õ Õ Õ վÕ խկոÕ Õ ր Õ սկ մեծ եղբÕ յրը Õ Õ ըÕ դհÕ Õ Õ րÕ Õ հÕ մոզում Õ ր որ Õ մեÕ Õ Õ չ լÕ վ կլÕ Õ Õ որ չվÕ խեÕ Õ ՀÕ զÕ վ Õ Õ Õ բÕ րձրÕ ցել վերև երբ փոքր եղբÕ յրը չÕ կÕ Õ եց գեÕ Õ Õ Õ դրվÕ ծ Õ Õ խÕ Õ կÕ երը ոÕ քով դÕ պÕ վ դրÕ Õ ց ու վÕ յր ըÕ կÕ վ ՔÕ Õ Õ որ փոքր Õ ր Õ սկույÕ սկսեց լÕ ց լÕ Õ ել Õ սկ մեծ եղբÕ յրը Õ րÕ Õ հÕ Õ գսÕ Õ ցրեց Õ սելով որ դÕ կլÕ Õ Õ Õ րեÕ ց գÕ ղÕ Õ Õ քը և ոչ ոք Õ յդ մÕ սÕ Õ չÕ Õ մÕ Õ Õ | |
WordPress.com Debug | |
11:42 AM (32 minutes ago) | |
to greg | |
Text: |
This file contains 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
function es_api_detect_lang( $text ) { | |
$lang = false; | |
//if we can't tell the lang with 5000 characters we probably can't tell the language | |
$text = mb_substr( $text, 0, 5000 ); | |
//replace non-breaking spaces so they don't match the \p{L} char class | |
$text = preg_replace( '/[\x{00A0}\x{2007}\x{202F}]/u', ' ', $text ); | |
//replace unicode symbols: see: http://www.utf8-chartable.de/unicode-utf8-table.pl |
This file contains 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
public static function post( $blog_id, $post_id, $mlt_fields = array( 'mlt_content' ), $analyzer = false ) { | |
switch_to_blog( $blog_id ); | |
$post = get_post( $post_id ); | |
$fld_bldr = new ES_WP_Field_Builder(); | |
$tax_data = $fld_bldr->taxonomy( $post ); | |
$mlt_content = $fld_bldr->mlt_content( array( | |
'title' => $fld_bldr->clean_string( $post->post_title ), | |
'content' => $fld_bldr->clean_string( $post->post_content ), |
OlderNewer