More Like This Query for field that called type


(Vitalii) #1

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
     }

(Vitalii) #2

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


(Vitalii) #3

always get this error

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


(Vitalii) #4

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

(system) #5

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