Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// This uses the wpes-lib framework to build the index: https://github.com/automattic/wpes-lib
class WPOrg_Plugins_Index_Builder extends VIP_Index_Builder {
//override to add support for all analyzers
public function get_settings( $args ) {
$defaults = array(
);
$args = wp_parse_args( $args, $defaults );
//All langs
$analyzer_builder = new WPES_Analyzer_Builder();
$analyzers = $analyzer_builder->build_analyzers();
//optimized for VIP cluster
$global_settings = array(
'number_of_shards' => 1,
'number_of_replicas' => 2,
'analysis' => $analyzers,
);
return $global_settings;
}
//override for different mappings
public function get_mappings( $args ) {
$post_fld_bldr = new WPES_WPCOM_Post_Field_Builder();
////////////////Post Mapping for plugins//////////////////
$post_mapping = $post_fld_bldr->get_mappings( array(
'index_meta' => true,
'index_mlt_content' => true,
) );
unset( $post_mapping['properties']['blog'] );
unset( $post_mapping['_analyzer'] ); //separate fields for each analyzer, default analyzer will be used on non _<lang> fields
//adjust fielddata mappings to improve memory utilization
// doc values uses disk and file os cache to store field data rather than Heap
$post_mapping['properties']['site_id']['doc_values'] = true;
$post_mapping['properties']['blog_id']['doc_values'] = true;
$post_mapping['properties']['post_id']['doc_values'] = true;
$post_mapping['properties']['post_type']['doc_values'] = true;
$post_mapping['properties']['date']['doc_values'] = true;
$post_mapping['properties']['modified']['doc_values'] = true;
$post_mapping['properties']['date_gmt']['doc_values'] = true;
$post_mapping['properties']['modified_gmt']['doc_values'] = true;
$post_mapping['properties']['like_count']['doc_values'] = true;
$post_mapping['properties']['comment_count']['doc_values'] = true;
$post_mapping['properties']['reblog_count']['doc_values'] = true;
$post_mapping['properties']['tag']['properties']['slug']['doc_values'] = true;
$post_mapping['properties']['category']['properties']['slug']['doc_values'] = true;
$post_mapping['properties']['tag']['properties']['term_id']['doc_values'] = true;
$post_mapping['properties']['category']['properties']['term_id']['doc_values'] = true;
$post_mapping['dynamic_templates'][1]['tax_template_slug']['mapping']['doc_values'] = true;
$post_mapping['dynamic_templates'][2]['tax_template_term_id']['mapping']['doc_values'] = true;
$post_mapping['dynamic_templates'][6]['meta_str_template']['mapping']['fields']['raw']['doc_values'] = true;
$post_mapping['dynamic_templates'][7]['meta_long_template']['mapping']['doc_values'] = true;
$post_mapping['dynamic_templates'][9]['meta_float_template']['mapping']['doc_values'] = true;
//add language customizations
$analyzer_builder = new WPES_Analyzer_Builder();
$analyzers = array_keys( $analyzer_builder->supported_languages );
$supported_langs = array_diff( $array, array( 'ngram', 'edgengram', 'lowercase', 'default' ) );
//treat upgrade notices the same as other content
$content_mapping_template = array(
'type' => 'multi_field',
'fields' => array(
'word_count' => array(
'type' => 'token_count',
'analyzer' => 'default',
)
)
);
$content_fld_mapping_template = array(
'type' => 'string',
'index' => 'analyzed',
'similarity' => 'BM25',
);
$post_mapping['properties']['upgrade_notice'] = $content_mapping_template;
$post_mapping['properties']['upgrade_notice']['fields']['upgrade_notice'] = $content_fld_mapping_template;
$lang_fields = array( 'title', 'content', 'excerpt', 'upgrade_notice' );
foreach( $lang_fields as $fld ) {
foreach( $supported_langs as $l ) {
$post_mapping['properties'][ $fld . '_' . $l ] = $content_mapping_template;
$post_mapping['properties'][ $fld . '_' . $l ]['fields'][ $fld . '_' . $l ] = $content_fld_mapping_template;
$post_mapping['properties'][ $fld . '_' . $l ]['fields'][ $fld . '_' . $l ]['analyzer'] = $l . '_analyzer';
$post_mapping['properties'][ $fld . '_' . $l ]['fields'][ 'word_count' ]['analyzer'] = $l . '_analyzer';
//add ngram per lang also
$post_mapping['properties'][ $fld . '_' . $l . '_ngram' ] = $content_fld_mapping_template;
$post_mapping['properties'][ $fld . '_' . $l . '_ngram' ]['analyzer'] = 'ngram_analyzer';
}
$post_mapping['properties'][ $fld . '_ngram' ] = $content_fld_mapping_template;
$post_mapping['properties'][ $fld . '_ngram' ]['analyzer'] = 'ngram_analyzer';
}
$post_mapping['properties']['slug_ngram'] = array(
'type' => 'string',
'index' => 'analyzed',
'analyzer' => 'ngram_analyzer',
'similarity' => 'BM25',
);
//Authors
$post_mapping['properties']['contributors'] = array(
'type' => 'string',
'index' => 'analyzed',
'analyzer' => 'ngram_analyzer',
'similarity' => 'BM25',
);
$post_mapping['properties']['header_author'] = array(
'type' => 'string',
'index' => 'analyzed',
'analyzer' => 'ngram_analyzer',
'similarity' => 'BM25',
);
//versions
$post_mapping['properties']['tested'] = array(
'type' => 'float',
'doc_values' => true,
);
$post_mapping['properties']['required'] = array(
'type' => 'float',
'doc_values' => true,
);
$post_mapping['properties']['stable_tag'] = array(
'type' => 'string',
'index' => 'not_analyzed',
'doc_values' => true,
);
$post_mapping['properties']['tagged_versions'] = array(
'type' => 'string',
'index' => 'not_analyzed',
'doc_values' => true,
);
$post_mapping['properties']['number_of_versions'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['number_of_translations'] = array(
'type' => 'long',
'doc_values' => true,
);
//Install info
$post_mapping['properties']['percent_on_stable'] = array(
'type' => 'float',
'doc_values' => true,
);
$post_mapping['properties']['active_installs'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['contributors_active_installs'] = array(
'type' => 'long',
'doc_values' => true,
);
//Support info
$post_mapping['properties']['support_resolution_yes'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['support_resolution_no'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['support_resolution_mu'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['support_resolution_percentage'] = array(
'type' => 'float',
'doc_values' => true,
);
$post_mapping['properties']['support_threads'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['support_threads_resolved'] = array(
'type' => 'long',
'doc_values' => true,
);
$post_mapping['properties']['support_thread_percentage'] = array(
'type' => 'float',
'doc_values' => true,
);
return array(
'post' => $post_mapping,
);
}
public function get_doc_callbacks() {
return array(
'post' => 'WPOrg_Plugin_Doc_Builder',
);
}
}
class WPOrg_Plugin_Doc_Builder extends VIP_Post_Doc_Builder {
//override to add new fields
public function doc( $args ) {
$fld_bldr = new WPES_WPCOM_Post_Field_Builder();
$data = parent::doc( $args );
//add language customizations
$analyzer_builder = new WPES_Analyzer_Builder();
$supported_langs = array_keys( $analyzer_builder->supported_languages );
$supported_langs = array_diff( $supported_langs, array( 'ngram', 'edgengram', 'lowercase', 'default', 'en' ) );
switch_to_blog( $args['blog_id'] );
//treat upgrade notices the same as other content
$post_mapping['properties']['upgrade_notice'] = $post_mapping['properties']['content'];
$notice = get_post_meta( $args['id'], 'upgrade_notice', true );
$notice = maybe_unserialize( $notice );
if ( is_array( $notice ) ) {
$notice = implode( ' ', array_values( $notice ) );
}
$data['upgrade_notice'] = $fld_bldr->clean_string( (string) $notice );
//dupe en content and ngram content
$lang_fields = array( 'title', 'content', 'excerpt', 'upgrade_notice' );
foreach( $lang_fields as $fld ) {
$data[ $fld . '_ngram' ] = $data[$fld];
$data[ $fld . '_en' ] = $data[$fld];
$data[ $fld . '_en_ngram' ] = $data[$fld];
}
$langs_translated = 0;
foreach( $supported_langs as $l ) {
foreach( $lang_fields as $fld ) {
$text = get_post_meta( $args['id'], $fld . '_' . $l, true );
if ( empty( $text ) ) {
$text = ""; //don't index anything if not translated
} else {
$langs_translated++;
}
$data[ $fld . '_' . $l ] = $fld_bldr->clean_string( (string) $text );
$data[ $fld . '_' . $l . '_ngram' ] = $fld_bldr->clean_string( (string) $text );
}
}
$data['number_of_translations'] = $langs_translated;
$data['slug_ngram'] = $data['slug'];
//Authors
$m = get_post_meta( $args['id'], 'contributors', true );
$obj = maybe_unserialize( $m );
$data['contributors'] = array();
if ( is_array( $obj ) ) {
foreach( $obj as $elem )
$data['contributors'][] = $fld_bldr->clean_string( (string) $elem );
}
$m = get_post_meta( $args['id'], 'header_author', true );
$data['header_author'] = $fld_bldr->clean_string( (string) $m );
//versions
$m = get_post_meta( $args['id'], 'tested', true );
$data['tested'] = $fld_bldr->clean_float( $m );
$m = get_post_meta( $args['id'], 'required', true );
$data['required'] = $fld_bldr->clean_float( $m );
$m = get_post_meta( $args['id'], 'stable_tag', true );
$data['stable_tag'] = $fld_bldr->clean_string( (string) $m );
$m = get_post_meta( $args['id'], 'tagged_versions', true );
$obj = maybe_unserialize( $m );
$data['tagged_versions'] = array();
if ( is_array( $obj ) ) {
foreach( $obj as $elem )
$data['tagged_versions'][] = $fld_bldr->clean_string( (string) $elem );
$data['number_of_versions'] = count( $obj );
} else {
$data['number_of_versions'] = 0;
}
//Install info
$m = get_post_meta( $args['id'], 'usage', true );
$obj = maybe_unserialize( $m );
$data['percent_on_stable'] = 0.0;
if ( is_array( $obj ) ) {
if ( isset( $obj[$data['stable_tag']] ) )
$data['percent_on_stable'] = $fld_bldr->clean_float( $obj[$data['stable_tag']] );
}
$m = get_post_meta( $args['id'], 'active_installs', true );
$data['active_installs'] = $fld_bldr->clean_long( $m, 'active_installs' );
//This value will only be correct after indexing twice - inception!
$result = es_api_search_index( array(
'name' => 'wordpress.org-plugins-wp',
'filter' => array(
'terms' => array(
'contributors' => $data['contributors']
)
),
'aggregations' => array( 'install-sum' => array(
'sum' => array(
'field' => 'active_installs'
)
) ),
'size' => 0,
'security_strategy' => 'a8c',
), 'wporg-plugin-contrib-installs' );
if ( is_wp_error( $result ) || !isset( $result['results']['aggregations']['install-sum']['value'] ) )
$data['contributors_active_installs'] = 0;
else
$data['contributors_active_installs'] = $fld_bldr->clean_long( (int) $result['results']['aggregations']['install-sum']['value'], 'contributors_active_installs' );
//Support info
$m = get_post_meta( $args['id'], 'support_resolution', true );
$obj = maybe_unserialize( $m );
if ( is_array( $obj ) ) {
$data['support_resolution_yes'] = $fld_bldr->clean_long( (int) $obj[$data['yes']], 'support_resolution_yes' );
$data['support_resolution_no'] = $fld_bldr->clean_long( (int) $obj[$data['no']], 'support_resolution_no' );
$data['support_resolution_mu'] = $fld_bldr->clean_long( (int) $obj[$data['mu']], 'support_resolution_mu' );
$data['support_resolution_percentage'] = $fld_bldr->clean_float( (float) $data['support_resolution_yes'] / ($data['support_resolution_yes'] + $data['support_resolution_no'] + $data['support_resolution_mu'] ) );
} else {
$data['support_resolution_yes'] = 0;
$data['support_resolution_no'] = 0;
$data['support_resolution_mu'] = 0;
$data['support_resolution_percentage'] = 100.0;
}
$m = get_post_meta( $args['id'], 'support_threads', true );
$data['support_threads'] = $fld_bldr->clean_long( $m, 'support_threads' );
$m = get_post_meta( $args['id'], 'support_threads_resolved', true );
$data['support_threads_resolved'] = $fld_bldr->clean_long( $m, 'support_threads_resolved' );
if ( 0 == $data['support_threads'] )
$data['support_threads_percentage'] = 100.0;
else
$data['support_threads_percentage'] = $fld_bldr->clean_float( (float) $data['support_threads_resolved'] / $data['support_threads'] );
restore_current_blog();
return $data;
}
}
{
"wordpress.org-plugins-wp-1": {
"mappings": {
"post": {
"_all": {
"enabled": false
},
"dynamic_templates": [
{
"tax_template_name": {
"mapping": {
"type": "multi_field",
"fields": {
"name": {
"type": "string",
"index": "analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"index": "analyzed",
"analyzer": "lowercase_analyzer"
}
}
},
"path_match": "taxonomy.*.name"
}
},
{
"tax_template_slug": {
"mapping": {
"type": "string",
"index": "not_analyzed",
"doc_values": true
},
"path_match": "taxonomy.*.slug"
}
},
{
"tax_template_term_id": {
"mapping": {
"type": "long",
"doc_values": true
},
"path_match": "taxonomy.*.term_id"
}
},
{
"has_template": {
"mapping": {
"type": "short"
},
"path_match": "has.*"
}
},
{
"shortcode_args_template": {
"mapping": {
"type": "string",
"index": "not_analyzed"
},
"path_match": "shortcode.*.id"
}
},
{
"shortcode_count_template": {
"mapping": {
"type": "short"
},
"path_match": "shortcode.*.count"
}
},
{
"meta_str_template": {
"mapping": {
"type": "multi_field",
"fields": {
"value": {
"type": "string",
"index": "analyzed"
},
"raw": {
"type": "string",
"index": "not_analyzed",
"doc_values": true
},
"raw_lc": {
"type": "string",
"index": "analyzed",
"analyzer": "lowercase_analyzer"
}
}
},
"path_match": "meta.*.value"
}
},
{
"meta_long_template": {
"mapping": {
"type": "long",
"doc_values": true
},
"path_match": "meta.*.long"
}
},
{
"meta_bool_template": {
"mapping": {
"type": "boolean"
},
"path_match": "meta.*.boolean"
}
},
{
"meta_float_template": {
"mapping": {
"type": "double",
"doc_values": true
},
"path_match": "meta.*.double"
}
}
],
"properties": {
"active_installs": {
"type": "long"
},
"ancestor_post_ids": {
"type": "long"
},
"author": {
"type": "string",
"similarity": "BM25",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
},
"author_id": {
"type": "integer"
},
"author_login": {
"type": "string",
"index": "not_analyzed"
},
"blog_id": {
"type": "integer",
"store": true
},
"category": {
"properties": {
"name": {
"type": "string",
"similarity": "BM25",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
},
"slug": {
"type": "string",
"index": "not_analyzed"
},
"term_id": {
"type": "long"
}
}
},
"comment_count": {
"type": "integer"
},
"commenter_ids": {
"type": "integer"
},
"content": {
"type": "string",
"similarity": "BM25",
"fields": {
"word_count": {
"type": "token_count",
"analyzer": "default"
}
}
},
"content_ar": {
"type": "string"
},
"content_ar_ngram": {
"type": "string"
},
"content_bg": {
"type": "string"
},
"content_bg_ngram": {
"type": "string"
},
"content_ca": {
"type": "string"
},
"content_ca_ngram": {
"type": "string"
},
"content_cs": {
"type": "string"
},
"content_cs_ngram": {
"type": "string"
},
"content_da": {
"type": "string"
},
"content_da_ngram": {
"type": "string"
},
"content_de": {
"type": "string"
},
"content_de_ngram": {
"type": "string"
},
"content_el": {
"type": "string"
},
"content_el_ngram": {
"type": "string"
},
"content_en": {
"type": "string"
},
"content_en_ngram": {
"type": "string"
},
"content_es": {
"type": "string"
},
"content_es_ngram": {
"type": "string"
},
"content_eu": {
"type": "string"
},
"content_eu_ngram": {
"type": "string"
},
"content_fa": {
"type": "string"
},
"content_fa_ngram": {
"type": "string"
},
"content_fi": {
"type": "string"
},
"content_fi_ngram": {
"type": "string"
},
"content_fr": {
"type": "string"
},
"content_fr_ngram": {
"type": "string"
},
"content_he": {
"type": "string"
},
"content_he_ngram": {
"type": "string"
},
"content_hi": {
"type": "string"
},
"content_hi_ngram": {
"type": "string"
},
"content_hu": {
"type": "string"
},
"content_hu_ngram": {
"type": "string"
},
"content_hy": {
"type": "string"
},
"content_hy_ngram": {
"type": "string"
},
"content_id": {
"type": "string"
},
"content_id_ngram": {
"type": "string"
},
"content_it": {
"type": "string"
},
"content_it_ngram": {
"type": "string"
},
"content_ja": {
"type": "string"
},
"content_ja_ngram": {
"type": "string"
},
"content_ko": {
"type": "string"
},
"content_ko_ngram": {
"type": "string"
},
"content_ngram": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"content_nl": {
"type": "string"
},
"content_nl_ngram": {
"type": "string"
},
"content_no": {
"type": "string"
},
"content_no_ngram": {
"type": "string"
},
"content_pt": {
"type": "string"
},
"content_pt_ngram": {
"type": "string"
},
"content_ro": {
"type": "string"
},
"content_ro_ngram": {
"type": "string"
},
"content_ru": {
"type": "string"
},
"content_ru_ngram": {
"type": "string"
},
"content_sv": {
"type": "string"
},
"content_sv_ngram": {
"type": "string"
},
"content_tr": {
"type": "string"
},
"content_tr_ngram": {
"type": "string"
},
"content_zh": {
"type": "string"
},
"content_zh_ngram": {
"type": "string"
},
"contributors": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"contributors_active_installs": {
"type": "long"
},
"date": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
},
"date_added": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
},
"date_gmt": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
},
"date_gmt_token": {
"properties": {
"day": {
"type": "byte"
},
"day_of_week": {
"type": "byte"
},
"day_of_year": {
"type": "short"
},
"hour": {
"type": "byte"
},
"minute": {
"type": "byte"
},
"month": {
"type": "byte"
},
"second": {
"type": "byte"
},
"seconds_from_day": {
"type": "integer"
},
"seconds_from_hour": {
"type": "short"
},
"week_of_year": {
"type": "byte"
},
"year": {
"type": "short"
}
}
},
"date_token": {
"properties": {
"day": {
"type": "byte"
},
"day_of_week": {
"type": "byte"
},
"day_of_year": {
"type": "short"
},
"hour": {
"type": "byte"
},
"minute": {
"type": "byte"
},
"month": {
"type": "byte"
},
"second": {
"type": "byte"
},
"seconds_from_day": {
"type": "integer"
},
"seconds_from_hour": {
"type": "short"
},
"week_of_year": {
"type": "byte"
},
"year": {
"type": "short"
}
}
},
"embed": {
"properties": {
"url": {
"type": "string",
"index": "not_analyzed"
}
}
},
"excerpt": {
"type": "string",
"similarity": "BM25",
"fields": {
"word_count": {
"type": "token_count",
"analyzer": "default"
}
}
},
"excerpt_ar": {
"type": "string"
},
"excerpt_ar_ngram": {
"type": "string"
},
"excerpt_bg": {
"type": "string"
},
"excerpt_bg_ngram": {
"type": "string"
},
"excerpt_ca": {
"type": "string"
},
"excerpt_ca_ngram": {
"type": "string"
},
"excerpt_cs": {
"type": "string"
},
"excerpt_cs_ngram": {
"type": "string"
},
"excerpt_da": {
"type": "string"
},
"excerpt_da_ngram": {
"type": "string"
},
"excerpt_de": {
"type": "string"
},
"excerpt_de_ngram": {
"type": "string"
},
"excerpt_el": {
"type": "string"
},
"excerpt_el_ngram": {
"type": "string"
},
"excerpt_en": {
"type": "string"
},
"excerpt_en_ngram": {
"type": "string"
},
"excerpt_es": {
"type": "string"
},
"excerpt_es_ngram": {
"type": "string"
},
"excerpt_eu": {
"type": "string"
},
"excerpt_eu_ngram": {
"type": "string"
},
"excerpt_fa": {
"type": "string"
},
"excerpt_fa_ngram": {
"type": "string"
},
"excerpt_fi": {
"type": "string"
},
"excerpt_fi_ngram": {
"type": "string"
},
"excerpt_fr": {
"type": "string"
},
"excerpt_fr_ngram": {
"type": "string"
},
"excerpt_he": {
"type": "string"
},
"excerpt_he_ngram": {
"type": "string"
},
"excerpt_hi": {
"type": "string"
},
"excerpt_hi_ngram": {
"type": "string"
},
"excerpt_hu": {
"type": "string"
},
"excerpt_hu_ngram": {
"type": "string"
},
"excerpt_hy": {
"type": "string"
},
"excerpt_hy_ngram": {
"type": "string"
},
"excerpt_id": {
"type": "string"
},
"excerpt_id_ngram": {
"type": "string"
},
"excerpt_it": {
"type": "string"
},
"excerpt_it_ngram": {
"type": "string"
},
"excerpt_ja": {
"type": "string"
},
"excerpt_ja_ngram": {
"type": "string"
},
"excerpt_ko": {
"type": "string"
},
"excerpt_ko_ngram": {
"type": "string"
},
"excerpt_ngram": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"excerpt_nl": {
"type": "string"
},
"excerpt_nl_ngram": {
"type": "string"
},
"excerpt_no": {
"type": "string"
},
"excerpt_no_ngram": {
"type": "string"
},
"excerpt_pt": {
"type": "string"
},
"excerpt_pt_ngram": {
"type": "string"
},
"excerpt_ro": {
"type": "string"
},
"excerpt_ro_ngram": {
"type": "string"
},
"excerpt_ru": {
"type": "string"
},
"excerpt_ru_ngram": {
"type": "string"
},
"excerpt_sv": {
"type": "string"
},
"excerpt_sv_ngram": {
"type": "string"
},
"excerpt_tr": {
"type": "string"
},
"excerpt_tr_ngram": {
"type": "string"
},
"excerpt_zh": {
"type": "string"
},
"excerpt_zh_ngram": {
"type": "string"
},
"has": {
"properties": {
"gallery": {
"type": "short"
},
"hashtag": {
"type": "short"
},
"image": {
"type": "short"
},
"link": {
"type": "short"
},
"mention": {
"type": "short"
},
"shortcode": {
"type": "short"
}
}
},
"has_password": {
"type": "boolean"
},
"hashtag": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
}
}
},
"header_author": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"image": {
"properties": {
"url": {
"type": "string",
"index": "not_analyzed"
}
}
},
"is_reblogged": {
"type": "boolean"
},
"lang": {
"type": "string",
"index": "not_analyzed"
},
"lang_analyzer": {
"type": "string",
"index": "not_analyzed"
},
"like_count": {
"type": "short"
},
"liker_ids": {
"type": "integer"
},
"link": {
"properties": {
"host": {
"type": "string",
"index": "not_analyzed"
},
"host_reversed": {
"type": "string",
"index": "not_analyzed"
},
"url": {
"type": "string",
"similarity": "BM25",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
},
"location": {
"type": "geo_point",
"lat_lon": true,
"geohash": true
},
"mention": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed",
"fields": {
"lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"menu_order": {
"type": "integer"
},
"meta": {
"properties": {
"active_installs": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"assets_banners": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"assets_banners_color": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"assets_icons": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"assets_screenshots": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"contributors": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"donate_link": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_author": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_author_uri": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_description": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_name": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_plugin_uri": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"header_textdomain": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"note": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"permalink": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"requires": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"screenshots": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"sections": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"stable_tag": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"support_resolutions": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"support_threads": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"support_threads_resolved": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"tagged_versions": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"tags": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"tested": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"upgrade_notice": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"usage": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
},
"version": {
"properties": {
"boolean": {
"type": "boolean"
},
"double": {
"type": "double"
},
"long": {
"type": "long"
},
"value": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
}
}
}
}
},
"mlt_content": {
"type": "string",
"similarity": "BM25"
},
"modified": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
},
"modified_gmt": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
},
"modified_gmt_token": {
"properties": {
"day": {
"type": "byte"
},
"day_of_week": {
"type": "byte"
},
"day_of_year": {
"type": "short"
},
"hour": {
"type": "byte"
},
"minute": {
"type": "byte"
},
"month": {
"type": "byte"
},
"second": {
"type": "byte"
},
"seconds_from_day": {
"type": "integer"
},
"seconds_from_hour": {
"type": "short"
},
"week_of_year": {
"type": "byte"
},
"year": {
"type": "short"
}
}
},
"modified_token": {
"properties": {
"day": {
"type": "byte"
},
"day_of_week": {
"type": "byte"
},
"day_of_year": {
"type": "short"
},
"hour": {
"type": "byte"
},
"minute": {
"type": "byte"
},
"month": {
"type": "byte"
},
"second": {
"type": "byte"
},
"seconds_from_day": {
"type": "integer"
},
"seconds_from_hour": {
"type": "short"
},
"week_of_year": {
"type": "byte"
},
"year": {
"type": "short"
}
}
},
"number_of_translations": {
"type": "long"
},
"number_of_versions": {
"type": "long"
},
"parent_post_id": {
"type": "long"
},
"percent_on_stable": {
"type": "float"
},
"post_format": {
"type": "string",
"index": "not_analyzed"
},
"post_id": {
"type": "long",
"store": true
},
"post_status": {
"type": "string",
"index": "not_analyzed"
},
"post_type": {
"type": "string",
"index": "not_analyzed"
},
"public": {
"type": "boolean"
},
"reblog_count": {
"type": "short"
},
"reblogger_ids": {
"type": "integer"
},
"required": {
"type": "float"
},
"shortcode": {
"properties": {
"audio": {
"properties": {
"count": {
"type": "short"
}
}
},
"caption": {
"properties": {
"count": {
"type": "short"
}
}
},
"child-pages": {
"properties": {
"count": {
"type": "short"
}
}
},
"code": {
"properties": {
"count": {
"type": "short"
}
}
},
"contact-form": {
"properties": {
"count": {
"type": "short"
}
}
},
"display-posts": {
"properties": {
"count": {
"type": "short"
}
}
},
"embed": {
"properties": {
"count": {
"type": "short"
}
}
},
"gallery": {
"properties": {
"count": {
"type": "short"
}
}
},
"instagram": {
"properties": {
"count": {
"type": "short"
}
}
},
"latex": {
"properties": {
"count": {
"type": "short"
}
}
},
"list-pages": {
"properties": {
"count": {
"type": "short"
}
}
},
"playlist": {
"properties": {
"count": {
"type": "short"
}
}
},
"polldaddy": {
"properties": {
"count": {
"type": "short"
}
}
},
"sibling-pages": {
"properties": {
"count": {
"type": "short"
}
}
},
"sitemap": {
"properties": {
"count": {
"type": "short"
}
}
},
"slideshow": {
"properties": {
"count": {
"type": "short"
}
}
},
"soundcloud": {
"properties": {
"count": {
"type": "short"
}
}
},
"video": {
"properties": {
"count": {
"type": "short"
}
}
},
"vimeo": {
"properties": {
"count": {
"type": "short"
}
}
},
"wpvideo": {
"properties": {
"count": {
"type": "short"
},
"id": {
"type": "string",
"index": "not_analyzed"
}
}
},
"wufoo": {
"properties": {
"count": {
"type": "short"
}
}
},
"youtube": {
"properties": {
"count": {
"type": "short"
},
"id": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
},
"shortcode_types": {
"type": "string",
"index": "not_analyzed"
},
"site_id": {
"type": "short"
},
"slug": {
"type": "string",
"index": "not_analyzed"
},
"slug_ngram": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"stable_tag": {
"type": "string",
"index": "not_analyzed"
},
"sticky": {
"type": "boolean"
},
"support_resolution_mu": {
"type": "long"
},
"support_resolution_no": {
"type": "long"
},
"support_resolution_percentage": {
"type": "float"
},
"support_resolution_yes": {
"type": "long"
},
"support_thread_percentage": {
"type": "float"
},
"support_threads": {
"type": "long"
},
"support_threads_percentage": {
"type": "long"
},
"support_threads_resolved": {
"type": "long"
},
"tag": {
"properties": {
"name": {
"type": "string",
"similarity": "BM25",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
},
"slug": {
"type": "string",
"index": "not_analyzed"
},
"term_id": {
"type": "long"
}
}
},
"tag_cat_count": {
"type": "short"
},
"tagged_versions": {
"type": "string",
"index": "not_analyzed"
},
"taxonomy": {
"properties": {
"plugin_category": {
"properties": {
"name": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
},
"slug": {
"type": "string",
"index": "not_analyzed"
},
"term_id": {
"type": "long"
}
}
},
"plugin_tag": {
"properties": {
"name": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
},
"raw_lc": {
"type": "string",
"analyzer": "lowercase_analyzer"
}
}
},
"slug": {
"type": "string",
"index": "not_analyzed"
},
"term_id": {
"type": "long"
}
}
}
}
},
"tested": {
"type": "float"
},
"title": {
"type": "string",
"similarity": "BM25",
"fields": {
"word_count": {
"type": "token_count",
"analyzer": "default"
}
}
},
"title_ar": {
"type": "string"
},
"title_ar_ngram": {
"type": "string"
},
"title_bg": {
"type": "string"
},
"title_bg_ngram": {
"type": "string"
},
"title_ca": {
"type": "string"
},
"title_ca_ngram": {
"type": "string"
},
"title_cs": {
"type": "string"
},
"title_cs_ngram": {
"type": "string"
},
"title_da": {
"type": "string"
},
"title_da_ngram": {
"type": "string"
},
"title_de": {
"type": "string"
},
"title_de_ngram": {
"type": "string"
},
"title_el": {
"type": "string"
},
"title_el_ngram": {
"type": "string"
},
"title_en": {
"type": "string"
},
"title_en_ngram": {
"type": "string"
},
"title_es": {
"type": "string"
},
"title_es_ngram": {
"type": "string"
},
"title_eu": {
"type": "string"
},
"title_eu_ngram": {
"type": "string"
},
"title_fa": {
"type": "string"
},
"title_fa_ngram": {
"type": "string"
},
"title_fi": {
"type": "string"
},
"title_fi_ngram": {
"type": "string"
},
"title_fr": {
"type": "string"
},
"title_fr_ngram": {
"type": "string"
},
"title_he": {
"type": "string"
},
"title_he_ngram": {
"type": "string"
},
"title_hi": {
"type": "string"
},
"title_hi_ngram": {
"type": "string"
},
"title_hu": {
"type": "string"
},
"title_hu_ngram": {
"type": "string"
},
"title_hy": {
"type": "string"
},
"title_hy_ngram": {
"type": "string"
},
"title_id": {
"type": "string"
},
"title_id_ngram": {
"type": "string"
},
"title_it": {
"type": "string"
},
"title_it_ngram": {
"type": "string"
},
"title_ja": {
"type": "string"
},
"title_ja_ngram": {
"type": "string"
},
"title_ko": {
"type": "string"
},
"title_ko_ngram": {
"type": "string"
},
"title_ngram": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"title_nl": {
"type": "string"
},
"title_nl_ngram": {
"type": "string"
},
"title_no": {
"type": "string"
},
"title_no_ngram": {
"type": "string"
},
"title_pt": {
"type": "string"
},
"title_pt_ngram": {
"type": "string"
},
"title_ro": {
"type": "string"
},
"title_ro_ngram": {
"type": "string"
},
"title_ru": {
"type": "string"
},
"title_ru_ngram": {
"type": "string"
},
"title_sv": {
"type": "string"
},
"title_sv_ngram": {
"type": "string"
},
"title_tr": {
"type": "string"
},
"title_tr_ngram": {
"type": "string"
},
"title_zh": {
"type": "string"
},
"title_zh_ngram": {
"type": "string"
},
"upgrade_notice": {
"type": "string",
"similarity": "BM25",
"fields": {
"word_count": {
"type": "token_count",
"analyzer": "default"
}
}
},
"upgrade_notice_ar": {
"type": "string"
},
"upgrade_notice_ar_ngram": {
"type": "string"
},
"upgrade_notice_bg": {
"type": "string"
},
"upgrade_notice_bg_ngram": {
"type": "string"
},
"upgrade_notice_ca": {
"type": "string"
},
"upgrade_notice_ca_ngram": {
"type": "string"
},
"upgrade_notice_cs": {
"type": "string"
},
"upgrade_notice_cs_ngram": {
"type": "string"
},
"upgrade_notice_da": {
"type": "string"
},
"upgrade_notice_da_ngram": {
"type": "string"
},
"upgrade_notice_de": {
"type": "string"
},
"upgrade_notice_de_ngram": {
"type": "string"
},
"upgrade_notice_el": {
"type": "string"
},
"upgrade_notice_el_ngram": {
"type": "string"
},
"upgrade_notice_en": {
"type": "string"
},
"upgrade_notice_en_ngram": {
"type": "string"
},
"upgrade_notice_es": {
"type": "string"
},
"upgrade_notice_es_ngram": {
"type": "string"
},
"upgrade_notice_eu": {
"type": "string"
},
"upgrade_notice_eu_ngram": {
"type": "string"
},
"upgrade_notice_fa": {
"type": "string"
},
"upgrade_notice_fa_ngram": {
"type": "string"
},
"upgrade_notice_fi": {
"type": "string"
},
"upgrade_notice_fi_ngram": {
"type": "string"
},
"upgrade_notice_fr": {
"type": "string"
},
"upgrade_notice_fr_ngram": {
"type": "string"
},
"upgrade_notice_he": {
"type": "string"
},
"upgrade_notice_he_ngram": {
"type": "string"
},
"upgrade_notice_hi": {
"type": "string"
},
"upgrade_notice_hi_ngram": {
"type": "string"
},
"upgrade_notice_hu": {
"type": "string"
},
"upgrade_notice_hu_ngram": {
"type": "string"
},
"upgrade_notice_hy": {
"type": "string"
},
"upgrade_notice_hy_ngram": {
"type": "string"
},
"upgrade_notice_id": {
"type": "string"
},
"upgrade_notice_id_ngram": {
"type": "string"
},
"upgrade_notice_it": {
"type": "string"
},
"upgrade_notice_it_ngram": {
"type": "string"
},
"upgrade_notice_ja": {
"type": "string"
},
"upgrade_notice_ja_ngram": {
"type": "string"
},
"upgrade_notice_ko": {
"type": "string"
},
"upgrade_notice_ko_ngram": {
"type": "string"
},
"upgrade_notice_ngram": {
"type": "string",
"similarity": "BM25",
"analyzer": "ngram_analyzer"
},
"upgrade_notice_nl": {
"type": "string"
},
"upgrade_notice_nl_ngram": {
"type": "string"
},
"upgrade_notice_no": {
"type": "string"
},
"upgrade_notice_no_ngram": {
"type": "string"
},
"upgrade_notice_pt": {
"type": "string"
},
"upgrade_notice_pt_ngram": {
"type": "string"
},
"upgrade_notice_ro": {
"type": "string"
},
"upgrade_notice_ro_ngram": {
"type": "string"
},
"upgrade_notice_ru": {
"type": "string"
},
"upgrade_notice_ru_ngram": {
"type": "string"
},
"upgrade_notice_sv": {
"type": "string"
},
"upgrade_notice_sv_ngram": {
"type": "string"
},
"upgrade_notice_tr": {
"type": "string"
},
"upgrade_notice_tr_ngram": {
"type": "string"
},
"upgrade_notice_zh": {
"type": "string"
},
"upgrade_notice_zh_ngram": {
"type": "string"
},
"url": {
"type": "string",
"similarity": "BM25",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment