# "fields" ignored on MLT query with artificial document

**URL:** <https://discuss.elastic.co/t/fields-ignored-on-mlt-query-with-artificial-document/285933>\
**Category:** Elasticsearch\
**Created:** [October 5, 2021, 2:05pm UTC](https://discuss.elastic.co/t/fields-ignored-on-mlt-query-with-artificial-document/285933 "2021-10-05T14:05:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirco\_romagnoli](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mirco\_romagnoli](https://discuss.elastic.co/u/mirco_romagnoli)\
**Post date:** [October 5, 2021, 2:05pm UTC](https://discuss.elastic.co/t/fields-ignored-on-mlt-query-with-artificial-document/285933/1 "2021-10-05T14:05:42Z")

</div>

Hi everyone!  
When I execute an MLT query with an artificial document the "fields" field is ignored and all the fields from the artificial document are used for scoring.  
For instance I built an index with these settings:

```auto
PUT /myindex
{
    "mappings": {
        "properties": {
            "body": {
                "type": "text",
                "analyzer": "rebuilt_italian",
                "term_vector": "yes"
            },
            "url": {
                "type": "keyword"
            },
            "title": {
                "type": "text",
                "analyzer": "rebuilt_italian",
                "term_vector": "yes"
            }
        }
    },
    "settings": {
        "index": {
            "analysis": {
                "filter": {
                    "italian_stemmer": {
                        "type": "stemmer",
                        "language": "italian"
                    },
                    "italian_elision": {
                        "type": "elision",
                        "articles": [
                            "c",
                            "l",
                            "all",
                            "dall",
                            "dell",
                            "nell",
                            "sull",
                            "coll",
                            "pell",
                            "gl",
                            "agl",
                            "dagl",
                            "degl",
                            "negl",
                            "sugl",
                            "un",
                            "m",
                            "t",
                            "s",
                            "v",
                            "d"
                        ],
                        "articles_case": "true"
                    },
                    "italian_stop": {
                        "type": "stop",
                        "stopwords": "_italian_"
                    }
                },
                "analyzer": {
                    "rebuilt_italian": {
                        "filter": [
                            "italian_elision",
                            "lowercase",
                            "italian_stop",
                            "italian_stemmer"
                        ],
                        "tokenizer": "standard"
                    }
                }
            }
        }
    }
}

```

And then I add this document:

```auto
PUT /myindex/_doc/1
{
    "title": "New document title",
    "body": "New document body",
    "url": "http://example.com"
}

```

When I explain the query with these parameters:

```auto
POST /myindex/_explain/1
{
    "query": {
        "more_like_this": {
            "fields": [
                "title",
                "url"
            ],
            "like": [
                {
                    "doc": {
                        "title": "Document title",
                        "body": "Document body",
                        "url": "https://example.com"
                    }
                }
            ],
            "min_term_freq": 1,
            "min_doc_freq": 1,
            "max_query_terms": 12
        }
    }
}

```

I can see that the "body" field is used for scoring even if I didn't set it in the "fields".  
Is this the correct behavior?

Cheers,  
Mirco

edit: I'm using the version 7.15.0 of Elasticsearch

---

<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:** [November 2, 2021, 2:05pm UTC](https://discuss.elastic.co/t/fields-ignored-on-mlt-query-with-artificial-document/285933/2 "2021-11-02T14:05:45Z")

</div>

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