Simple query string, default operator and, doesn't work with nested objects

Hello everyone, as mentioned in the title, seem like simple_query_string with default operator and doesn't work with nested data type.

For example, i have a mapping like bellow:

PUT test1
{
  "mappings": {
    "properties": {
      "nested_articles" : {
          "type" : "nested",
          "properties" : {
            "article_title" : {
              "properties" : {
                "en" : {
                  "type" : "keyword",
                  "fields" : {
                    "default" : {
                      "type" : "text",
                      "term_vector" : "with_positions_offsets",
                      "analyzer" : "english"
                    },
                    "exact" : {
                      "type" : "text",
                      "term_vector" : "with_positions_offsets",
                      "analyzer" : "english_exact"
                    }
                  },
                  "ignore_above" : 20
                }
              }
            },
            "content" : {
              "properties" : {
                "en" : {
                  "type" : "keyword",
                  "fields" : {
                    "default" : {
                      "type" : "text",
                      "term_vector" : "with_positions_offsets",
                      "analyzer" : "english"
                    },
                    "exact" : {
                      "type" : "text",
                      "term_vector" : "with_positions_offsets",
                      "analyzer" : "english_exact"
                    }
                  },
                  "ignore_above" : 20
                }
              }
            }
          }
        }
    }
  }
}

As you can see, nested_articles with type nested has two fields articles_title and content. Each field has two analyzers "default" (for stemming) et "exact" (pour exact search). I added a document like this:

PUT test1/_doc/1
{
  "nested_articles" : [
    {
      "article_title" : {
        "en": "John"
      },
      "content" : {
        "en": "Smith"
      }
    },
    {
      "article_title" : {
        "en": "foo"
      },
      "content" : {
        "en": "bar"
      }
    }
  ]
}

Problem come when i use simple_query_string

GET test1/_search
{
  "query": {
    "nested": {
      "path": "nested_articles",
      "query": {
        "simple_query_string": {
          "query": "smith bar",
          "fields": [
            "nested_articles.article_title.en.default^3",
            "nested_articles.content.en.default"
          ],
          "default_operator": "and"
        }
      }
    }
  }
}

I'm looking for the documents with two words "smith" and "bar", in any field but i have no result here. However, if i search for the words in the same objet (for example, John Smith with John in articles and Smith in content), It works like charm.
Do you have any solution (query or mapping) that can work with simple_query_string, default operator and ?
Thank you all.

After work around, i have one solution that use include_in_root and launch simple_query_string in this field. However, this solution doesn't keep the relation between articles and contents. In our usecase, this relation is really important.
Do you have any better solution?
Thank you all.

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