# I want to preferentially display records for which product images are set

**URL:** <https://discuss.elastic.co/t/i-want-to-preferentially-display-records-for-which-product-images-are-set/286378>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [October 11, 2021, 3:00pm UTC](https://discuss.elastic.co/t/i-want-to-preferentially-display-records-for-which-product-images-are-set/286378 "2021-10-11T15:00:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruby501a](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ruby501a](https://discuss.elastic.co/u/ruby501a)\
**Post date:** [October 11, 2021, 3:00pm UTC](https://discuss.elastic.co/t/i-want-to-preferentially-display-records-for-which-product-images-are-set/286378/1 "2021-10-11T15:00:13Z")

</div>

I have an App Search engine that has product data registered. Records with product images have their URLs stored, and records without them have nulls stored.  
Of these, I want to preferentially display the records for which the product image is set, and put the records without the product image in the back.

What is the most effective way to achieve this?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [October 11, 2021, 3:28pm UTC](https://discuss.elastic.co/t/i-want-to-preferentially-display-records-for-which-product-images-are-set/286378/2 "2021-10-11T15:28:19Z")

</div>

I would calculate an additional field and add it to your data when indexing named "has\_product\_image" (or something similar). Ex: `has_product_image: "true"`

I would then apply a value boost that boosts on the value `"true"` on the field `has_product_image`

---

<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:** [November 8, 2021, 3:28pm UTC](https://discuss.elastic.co/t/i-want-to-preferentially-display-records-for-which-product-images-are-set/286378/3 "2021-11-08T15:28:41Z")

</div>

Closed on November 8, 2021, 3:28pm UTC

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