# Newbie - how to alternate results around specific value

**URL:** <https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675>\
**Category:** Elasticsearch\
**Created:** [February 27, 2017, 5:41pm UTC](https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675 "2017-02-27T17:41:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticitm](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@elasticitm](https://discuss.elastic.co/u/elasticitm)\
**Post date:** [February 27, 2017, 5:41pm UTC](https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675/1 "2017-02-27T17:41:18Z")

</div>

Hallo @all,

assume we have the following results:  
product\_1,merchant\_A  
product\_2,merchant\_A  
product\_3,merchant\_B  
product\_4,merchant\_B  
product\_5,merchant\_C  
product\_6,merchant\_C

Is there a way to alternate the merchants ?  
product\_1,merchant\_A  
product\_3,merchant\_B  
product\_5,merchant\_C  
product\_2,merchant\_A  
product\_4,merchant\_B  
product\_6,merchant\_C

Thank you and Best Regards  
Daniel

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [February 27, 2017, 8:14pm UTC](https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675/2 "2017-02-27T20:14:14Z")

</div>

This is not possible no matter what application you use unless you write your own code. First, the application has to know that the set A,B,C is already returned and have to start from a new set and recognize the A,B,C order.

---

<div class="post-metadata">

**Author:** ![elasticitm](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@elasticitm](https://discuss.elastic.co/u/elasticitm)\
**Post date:** [March 1, 2017, 5:14pm UTC](https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675/3 "2017-03-01T17:14:56Z")

</div>

Hi Jimmy,  
Thank You for the answer. I've written the sorting in PHP know.  
Best Regards  
Daniel

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 29, 2017, 5:15pm UTC](https://discuss.elastic.co/t/newbie-how-to-alternate-results-around-specific-value/76675/4 "2017-03-29T17:15:24Z")

</div>

Closed on March 29, 2017, 5:15pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
