# Apply More Like This to subset data

**URL:** <https://discuss.elastic.co/t/apply-more-like-this-to-subset-data/230716>\
**Category:** Elasticsearch\
**Created:** [May 1, 2020, 2:16pm UTC](https://discuss.elastic.co/t/apply-more-like-this-to-subset-data/230716 "2020-05-01T14:16:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lschnei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lschnei/32/51893_2.png) [@lschnei](https://discuss.elastic.co/u/lschnei)\
**Post date:** [May 1, 2020, 2:16pm UTC](https://discuss.elastic.co/t/apply-more-like-this-to-subset-data/230716/1 "2020-05-01T14:16:31Z")

</div>

Hi there,

I'm trying to apply a more like this query to a subset of my data filtered for dates. I'd like the final score to only be the score of more like this on the subset.  
How should i proceed ?

I have been trying the following but it does not seem to work.

Thanks in advance.

```auto
    query ={
            'bool':{
                'must':[
                    {'range':{
                            'InsertDate':{
                                'lte':yyyy-mm-dd,
                                }
                            }
                        },
            {'more_like_this':{
                'fields':['agency','seriesName','title', 'text'],
                'like':[
                    {'_index':index,
                    '_id': id}
                    ],
                }
                }
            ]
            }
            }

```

---

<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:** [May 29, 2020, 2:16pm UTC](https://discuss.elastic.co/t/apply-more-like-this-to-subset-data/230716/2 "2020-05-29T14:16:32Z")

</div>

Closed on May 29, 2020, 2:16pm UTC

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