More Like This Query for field that called type

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
     }

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

always get this error

more_like_this doesn't support binary/numeric fields: [type]

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 }},
                ]
            }

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