当前位置: 首页>>代码示例>>PHP>>正文


PHP Mapping::getProperties方法代码示例

本文整理汇总了PHP中Elastica\Type\Mapping::getProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapping::getProperties方法的具体用法?PHP Mapping::getProperties怎么用?PHP Mapping::getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Elastica\Type\Mapping的用法示例。


在下文中一共展示了Mapping::getProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateElasticsearchMapping

 /**
  * Add a mapping for the location of the photograph
  */
 public function updateElasticsearchMapping(\Elastica\Type\Mapping $mapping)
 {
     // get the properties of the individual fields as an array
     $properties = $mapping->getProperties();
     // enable tags to be faceted
     $properties['RawValue'] = array('type' => 'string', 'index' => 'not_analyzed');
     // set the new properties on the mapping
     $mapping->setProperties($properties);
     return $mapping;
 }
开发者ID:gordonbanderson,项目名称:flickr-editor,代码行数:13,代码来源:FlickrTagElasticaIndexingExtension.php

示例2: updateElasticsearchMapping

 /**
  * Add a mapping for the location of the photograph
  */
 public function updateElasticsearchMapping(\Elastica\Type\Mapping $mapping)
 {
     // get the properties of the individual fields as an array
     $properties = $mapping->getProperties();
     // add a location with geo point
     $precision1cm = array('format' => 'compressed', 'precision' => '1cm');
     $properties['location'] = array('type' => 'geo_point', 'fielddata' => $precision1cm);
     $properties['ShutterSpeed'] = array('type' => 'string', 'index' => 'not_analyzed');
     $properties['Aperture'] = array('type' => 'double');
     // by default casted as a string, we want a date 2015-07-25 18:15:33 y-M-d H:m:s
     $properties['TakenAt'] = array('type' => 'date', 'format' => 'y-M-d H:m:s');
     // set the new properties on the mapping
     $mapping->setProperties($properties);
     return $mapping;
 }
开发者ID:gordonbanderson,项目名称:flickr-editor,代码行数:18,代码来源:FlickrPhotoElasticaIndexingExtension.php

示例3: testGetters

 /**
  * @group functional
  */
 public function testGetters()
 {
     $index = $this->_createIndex();
     $type = $index->getType('test');
     $properties = array('firstname' => array('type' => 'string', 'store' => true), 'lastname' => array('type' => 'string'));
     $mapping = new Mapping($type, $properties);
     $all = array('enabled' => true, 'store' => true);
     $mapping->setParam('_all', $all);
     $get_all = $mapping->getParam('_all');
     $this->assertEquals($get_all, $all);
     $this->assertNull($mapping->getParam('_boost', $all));
     $this->assertEquals($properties, $mapping->getProperties());
     $index->delete();
 }
开发者ID:zhangxiaoliu,项目名称:Elastica,代码行数:17,代码来源:MappingTest.php


注:本文中的Elastica\Type\Mapping::getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。