Advertisement
nainy

es_map

Dec 16th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.19 KB | None | 0 0
  1. //mapping
  2. return [
  3.             '_all' => [
  4.                 'enabled' => false
  5.             ],
  6.             'dynamic_templates' => [
  7.                 [
  8.                     'nested_filter' => [
  9.                         'match' => 'filter',
  10.                         'mapping' => [
  11.                             'type' => 'nested',
  12.                             'include_in_parent' => true
  13.                         ]
  14.                     ]
  15.                 ],
  16.                 [
  17.                     'nested_template_str' => [
  18.                         'path_match' => 'filter.*',
  19.                         'mapping' => [
  20.                             'type' => '{dynamic_type}',
  21.                             'index' => 'not_analyzed',
  22.                             "doc_values" => true
  23.                         ]
  24.                     ]
  25.                 ]
  26.             ],
  27.             'properties' => [
  28.                 'id' => [
  29.                     'type' => 'integer',
  30.                     'index' => 'not_analyzed',
  31.                     "doc_values" => true
  32.                 ],
  33.                 'name' => [
  34.                     'type' => 'string',
  35.                     "analyzer" => "index_ru",
  36.                     "search_analyzer" => "search_ru",
  37.                     "term_vector" => "with_positions_offsets"
  38.                 ],
  39.                 'address' => [
  40.                     'type' => 'string',
  41.                     "analyzer" => "index_ru",
  42.                     "search_analyzer" => "search_ru",
  43.                 ],
  44.                 'location' => [
  45.                     'type' => 'geo_point',
  46.                     "doc_values" => true
  47.                 ],
  48.                 'city' => [
  49.                     'type' => 'string',
  50.                     "analyzer" => "index_ru",
  51.                     "search_analyzer" => "search_ru",
  52.                 ],
  53.                 'description' => [
  54.                     'type' => 'string',
  55.                     "analyzer" => "search_ru",
  56.                     "search_analyzer" => "search_ru",
  57.                 ],
  58.                 'tags' => [
  59.                     'type' => 'string',
  60.                     "analyzer" => "tag",
  61.                     "search_analyzer" => "tag",
  62.                     "term_vector" => "with_positions_offsets"
  63.                 ],
  64.                 'categoryName' => [
  65.                     'type' => 'string',
  66.                     "analyzer" => "index_ru",
  67.                     "search_analyzer" => "search_ru",
  68.                     "term_vector" => "with_positions_offsets"
  69.                 ],
  70.                 'subcategoriesNames' => [
  71.                     'type' => 'string',
  72.                     "analyzer" => "index_ru",
  73.                     "search_analyzer" => "search_ru",
  74.                     "term_vector" => "with_positions_offsets"
  75.                 ],
  76.                 'specializationsNames' => [
  77.                     'type' => 'string',
  78.                     "analyzer" => "index_ru",
  79.                     "search_analyzer" => "search_ru",
  80.                 ],
  81.                 'services' => [
  82.                     'type' => 'string',
  83.                     "analyzer" => "index_ru",
  84.                     "search_analyzer" => "search_ru",
  85.                 ]
  86.             ]
  87.         ];
  88.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement