Skip to content

Instantly share code, notes, and snippets.

@uprise10
Created October 27, 2016 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uprise10/121b981a0e3948a279ef63e30e626464 to your computer and use it in GitHub Desktop.
Save uprise10/121b981a0e3948a279ef63e30e626464 to your computer and use it in GitHub Desktop.
<?php
$mapping = [
'articles_template' => [
'path_match' => 'articles.*.terms.*',
'mapping' => [
'type' => 'object',
'path' => 'full',
'properties' => [
'title' => [
'type' => 'string',
'fields' => [
'title' => [
'type' => 'string',
'index' => 'analyzed',
'analyzer' => 'wp_analyzer',
],
'raw' => [
'type' => 'string',
'index' => 'not_analyzed',
],
],
],
'id' => [
'type' => 'long',
],
'terms' => [
'type' => 'object',
'properties' => [
'name' => [
'type' => 'string',
'fields' => [
'title' => [
'type' => 'string',
'index' => 'analyzed',
'analyzer' => 'wp_analyzer',
],
'raw' => [
'type' => 'string',
'index' => 'not_analyzed',
],
],
],
'term_id' => [
'type' => 'long',
],
'parent' => [
'type' => 'long',
],
'slug' => [
'type' => 'string',
'index' => 'not_analyzed',
],
],
],
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment