# More Like This Query for field that called type

**URL:** <https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955>\
**Category:** Elasticsearch\
**Created:** [February 4, 2017, 6:55pm UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955 "2017-02-04T18:55:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fix2015](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fix2015](https://discuss.elastic.co/u/fix2015)\
**Post date:** [February 4, 2017, 6:55pm UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955/1 "2017-02-04T18:55:57Z")

</div>

Hy i get this query and need add type(field of poject) = 2 and can't understand where i should put

> ```
> debug: `similarProjects`,
> index: `project`,
> type: `project`,
> query: {
> more_like_this: {
> like: [{
> _index: `project`,
> _type: `project`,
> _id: id
> }],
> min_term_freq: 1,
> min_doc_freq: 1
> }
> },
> pageSize: count,
> page: 0,
> fields
> 
> ```

```
     }

```

---

<div class="post-metadata">

**Author:** ![fix2015](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fix2015](https://discuss.elastic.co/u/fix2015)\
**Post date:** [February 4, 2017, 9:12pm UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955/2 "2017-02-04T21:12:21Z")

</div>

and can we do search by custom filed which called type?

---

<div class="post-metadata">

**Author:** ![fix2015](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fix2015](https://discuss.elastic.co/u/fix2015)\
**Post date:** [February 5, 2017, 10:25am UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955/3 "2017-02-05T10:25:00Z")

</div>

always get this error

> more\_like\_this doesn't support binary/numeric fields: [type]

---

<div class="post-metadata">

**Author:** ![fix2015](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@fix2015](https://discuss.elastic.co/u/fix2015)\
**Post date:** [February 5, 2017, 11:27am UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955/4 "2017-02-05T11:27:56Z")

</div>

i tried do like this but it always return same result

```
        query: {
            bool: {
                must: [
                    { match: { _index: `project` }},
                    { match: { _type: `project` }},
                    { match: { type: 2 }}
                ],
                should: [
                    { match: { _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:** [March 5, 2017, 11:28am UTC](https://discuss.elastic.co/t/more-like-this-query-for-field-that-called-type/73955/5 "2017-03-05T11:28:12Z")

</div>

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