Code Duplication    Length = 10-12 lines in 2 locations

src/Kunstmaan/SearchBundle/Provider/ElasticaProvider.php 2 locations

@@ 91-100 (lines=10) @@
88
     *
89
     * @return \Elastica\Response
90
     */
91
    public function addDocument($indexName, $indexType, $document, $uid)
92
    {
93
        $doc = $this->createDocument($uid, $document);
94
        $index = $this->getClient()->getIndex($indexName);
95
        if (method_exists($index, 'getType')) {
96
            return $index->getType($indexType)->addDocument($doc);
97
        }
98
99
        return $index->addDocument($doc);
100
    }
101
102
    /**
103
     * @param array  $docs
@@ 136-147 (lines=12) @@
133
     *
134
     * @return \Elastica\Bulk\ResponseSet
135
     */
136
    public function deleteDocuments($indexName, $indexType, array $ids)
137
    {
138
        $index = $this->getIndex($indexName);
139
140
        if (method_exists($index, 'getType')) {
141
            $type = $index->getType($indexType);
142
143
            return $this->getClient()->deleteIds($ids, $index, $type);
144
        }
145
146
        return $this->getClient()->deleteIds($ids, $index);
147
    }
148
149
    /**
150
     * @param string $indexName