# How to Match specific Variation Combinations

**URL:** <https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [September 22, 2020, 10:46pm UTC](https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591 "2020-09-22T22:46:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kurt\_Sahlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kurt_sahlin/32/47010_2.png) [@Kurt\_Sahlin](https://discuss.elastic.co/u/Kurt_Sahlin)\
**Post date:** [September 22, 2020, 10:46pm UTC](https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591/1 "2020-09-22T22:46:20Z")

</div>

I have an ecommerce solution for classes that we are using Appsearch. We are indexing Parent classes with Child class attributes for specific sections

for example:  
Class ABC  
Section 1, Jan 1 @ 8am  
Section 2, Jan 15 @ 10am  
Section 3, Feb 1 @ 2pm

We're indexing:  
Title: Class ABC  
StartDates array [jan 1, jan 15, feb 1]  
StartTimes array [8am, 10am, 2pm]

We now need to be able to filter results for a starting date rate, AND a Starting time range and retrieve the appropriate results.

Example:

1. StartDates between Jan 15 and Feb 15 AND StartTimes between 8am and 11am. It should return the above parent in the results because Jan 15 starts at 10am.
2. StartDates between Jan 15 and Feb 15 AND StartTimes between 8am and 9am. No results should be returned because both constraints can't be satisfied.

Can that be accomplished in Appsearch? We are having trouble getting that request to work.

Elasticsearch supports "Nested object" and/or "join" features to support this requirement ... are those in Appsearch?

---

<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:** [September 30, 2020, 11:32am UTC](https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591/2 "2020-09-30T11:32:56Z")

</div>

Hey @Kurt_Sahlin,

I have not found a great way to accomplish this in App Search.

App Search has no support for nested documents which makes it really hard.

Instead of indexing documents at a Class level, you'd almost need to index them at a "Section" level.

Section 1  
startDate: Jan 1  
startTime: 8am  
class: ABC

Section 2  
startDate: Jan 5  
startTime: 10am  
class: ABC

Section 3  
startDate: Feb 1  
startTime: 2pm  
class: ABC

I realize that's probably not what you're looking for though.

---

<div class="post-metadata">

**Author:** ![Kurt\_Sahlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kurt_sahlin/32/47010_2.png) [@Kurt\_Sahlin](https://discuss.elastic.co/u/Kurt_Sahlin)\
**Post date:** [September 30, 2020, 5:46pm UTC](https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591/3 "2020-09-30T17:46:50Z")

</div>

Thanks for the update. Yes, we're going to have to look at doing a 2nd query into a section by section index.

---

<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:** [October 28, 2020, 5:47pm UTC](https://discuss.elastic.co/t/how-to-match-specific-variation-combinations/249591/4 "2020-10-28T17:47:02Z")

</div>

Closed on October 28, 2020, 5:47pm UTC

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