Code Duplication    Length = 3-3 lines in 6 locations

mod/elgg_solr/lib/hooks.php 6 locations

@@ 20-22 (lines=3) @@
17
        'fields' => array('id','title','description', 'score'),
18
    );
19
	
20
	if ($params['select'] && is_array($params['select'])) {
21
        $select = array_merge($select, $params['select']);
22
    }
23
24
    // create a client instance
25
    $client = elgg_solr_get_client();
@@ 220-222 (lines=3) @@
217
        'fields' => array('id','title','description','score')
218
    );
219
	
220
	if ($params['select'] && is_array($params['select'])) {
221
        $select = array_merge($select, $params['select']);
222
    }
223
	
224
    // create a client instance
225
    $client = elgg_solr_get_client($select);
@@ 414-416 (lines=3) @@
411
    	$select['fields'][] = 'user_type';
412
    }
413
	
414
	if ($params['select'] && is_array($params['select'])) {
415
        $select = array_merge($select, $params['select']);
416
    }
417
418
    // create a client instance
419
    $client = elgg_solr_get_client();
@@ 627-629 (lines=3) @@
624
        'fields' => array('id','name','description', 'score')
625
    );
626
	
627
	if ($params['select'] && is_array($params['select'])) {
628
        $select = array_merge($select, $params['select']);
629
    }
630
631
    // create a client instance
632
    $client = elgg_solr_get_client();
@@ 883-885 (lines=3) @@
880
        'fields' => array('id','title','description','score')
881
    );
882
	
883
	if ($params['select'] && is_array($params['select'])) {
884
        $select = array_merge($select, $params['select']);
885
    }
886
887
	$client = elgg_solr_get_client();
888
// get an update query instance
@@ 1073-1075 (lines=3) @@
1070
        'fields' => array('id', 'container_guid', 'description', 'owner_guid', 'time_created', 'score'),
1071
    );
1072
	
1073
	if ($params['select'] && is_array($params['select'])) {
1074
        $select = array_merge($select, $params['select']);
1075
    }
1076
1077
    // create a client instance
1078
    $client = elgg_solr_get_client();