コード例 #1
0
 /**
  * insert
  *
  * @param array/string $data
  * @access public
  * @return void
  */
 public function insert($data)
 {
     if (is_array($data)) {
         $data = \SplFixedArray::fromArray($data);
     }
     if (!$data instanceof \Iterator) {
         $data = \SplFixedArray::fromArray([$data]);
     }
     $transformedList = $this->transformer->transform($data);
     return $this->writer->insert($transformedList);
 }
コード例 #2
0
 /**
  * find
  *
  * @param string $query
  * @param float $threshold
  * @access public
  * @return \Iterator<SimstringResult>
  */
 public function find($query, $threshold = null, $minThreshold = null, $gap = 0.1)
 {
     $list = $this->client->find($query, $threshold, $minThreshold, $gap);
     $transformedList = $this->transformer->reverseTransform($list);
     return $transformedList;
 }