# How to query terms which are neighbour of provided terms?

**URL:** <https://discuss.elastic.co/t/how-to-query-terms-which-are-neighbour-of-provided-terms/194710>\
**Category:** Elasticsearch\
**Created:** [August 10, 2019, 12:09pm UTC](https://discuss.elastic.co/t/how-to-query-terms-which-are-neighbour-of-provided-terms/194710 "2019-08-10T12:09:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticpatrick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticpatrick/32/49939_2.png) [@elasticpatrick](https://discuss.elastic.co/u/elasticpatrick)\
**Post date:** [August 10, 2019, 12:09pm UTC](https://discuss.elastic.co/t/how-to-query-terms-which-are-neighbour-of-provided-terms/194710/1 "2019-08-10T12:09:04Z")

</div>

Hello, I used to go market every day and take pictures of different products which contain brand names. A product can have zero brand names or multiple brand names. I do analysis on the products photos and retrieve brand names from the photo and add a ranking of how well brand name is analyze and store it in database. Now I would like to match query and get the brand names based on the higher ranking, set for the brand name. And after that if I have selected some brand name then I would like to get the new brand names from the photos which contain the selected brand name. I also need to know what will be the correct format for storing this type of data in documents.

---

<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:** [September 7, 2019, 12:09pm UTC](https://discuss.elastic.co/t/how-to-query-terms-which-are-neighbour-of-provided-terms/194710/2 "2019-09-07T12:09:06Z")

</div>

Closed on September 7, 2019, 12:09pm UTC

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