Исхдный:
<div class='inner'>
<div class="search_info">1</div>
<div class="search_info">2</div>
<div class="search_info2">3</div>
<div class="search_info">4</div>
<div class="search_info">5</div>
<div class="search_info2">6</div>
<div class="search_info">7</div>
</div>
<div class='inner'>
<div class="search_info">1</div>
<div class="search_info2">2</div>
<div class="search_info">3</div>
<div class="search_info">4</div>
<div class="search_info2">5</div>
<div class="search_info">6</div>
<div class="search_info2">7</div>
</div>
Получается:
<div class="inner">
<div style="border: thick solid red;">
<div class="search_info">1</div>
<div class="search_info">2</div>
<div class="search_info">4</div>
<div class="search_info">5</div>
<div class="search_info">7</div>
<div class="search_info">1</div>
<div class="search_info">3</div>
<div class="search_info">4</div><
div class="search_info">6</div>
</div>
<div style="border: thick solid green;">
<div class="search_info2">3</div>
<div class="search_info2">6</div>
<div class="search_info2">2</div>
<div class="search_info2">5</div>
<div class="search_info2">7</div>
</div>
</div>
<div class="inner">
</div>
А надо:
<div class="inner">
<div style="border: thick solid red;">
<div class="search_info">1</div>
<div class="search_info">2</div>
<div class="search_info">4</div>
<div class="search_info">5</div>
<div class="search_info">7</div>
</div>
<div style="border: thick solid green;">
<div class="search_info2">3</div>
<div class="search_info2">6</div>
</div>
</div>
<div class="inner">
<div style="border: thick solid red;">
<div class="search_info">1</div>
<div class="search_info">3</div>
<div class="search_info">4</div>
<div class="search_info">6</div>
</div>
<div style="border: thick solid green;">
<div class="search_info2">2</div>
<div class="search_info2">5</div>
<div class="search_info2">7</div>
</div>
</div>
JS:
https://jsfiddle.net/q0pbpm7m/2/
var newElem = $("<div/>").css("border", "thick solid red");
var newElem2 = $("<div/>").css("border", "thick solid green");
$(".inner").children('.search_info').wrapAll(newElem);
$(".inner").children('.search_info2').wrapAll(newElem2);