title: Elasticsearch - I am struggling to write a query on a field where 2 criteria need to be met
body: <p>I am struggling to write a query on a field where 2 criteria need to be met for a dashboard in Kibana. My field name is test:keyword and I need the results to be where Test A <strong>and</strong> Test B have the result:keyword (another field) as PASS</p>
  <pre><code>{ &quot;query&quot;: { 
   &quot;match_phrase&quot;: { 
    &quot;test.keyword&quot;: &quot;EOL_Overall_test_result&quot; } 
  } 
  </code></pre>
  <p>}</p>
  <p>so I need another criteria and test.keyword:&quot;EOL_flash_app_fw&quot;</p>
  <p>and these both need to have the result as:</p>
  <p>result.keyword:&quot;PASS&quot;</p>
  <pre><code> {
    &quot;mte&quot; : {
      &quot;mappings&quot; : {
        &quot;properties&quot; : {
          &quot;EESWVer&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;acdID&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;board&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;create&quot; : {
            &quot;properties&quot; : {
              &quot;board&quot; : {
                &quot;type&quot; : &quot;text&quot;,
                &quot;fields&quot; : {
                  &quot;keyword&quot; : {
                    &quot;type&quot; : &quot;keyword&quot;,
                    &quot;ignore_above&quot; : 256
                  }
                }
              },
              &quot;device&quot; : {
                &quot;type&quot; : &quot;text&quot;,
                &quot;fields&quot; : {
                  &quot;keyword&quot; : {
                    &quot;type&quot; : &quot;keyword&quot;,
                    &quot;ignore_above&quot; : 256
                  }
             }
          },
          &quot;reason&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;result&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;test&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;timeStamp&quot; : {
            &quot;type&quot; : &quot;date&quot;
              }
            }
          },
          &quot;device&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;hostname&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;reason&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;result&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;test&quot; : {
            &quot;type&quot; : &quot;text&quot;,
            &quot;fields&quot; : {
              &quot;keyword&quot; : {
                &quot;type&quot; : &quot;keyword&quot;,
                &quot;ignore_above&quot; : 256
              }
            }
          },
          &quot;timeStamp&quot; : {
            &quot;type&quot; : &quot;date&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <p><strong>DOCUMENT SAMPLE</strong></p>
  <pre><code>    {
    &quot;_index&quot;: &quot;mte&quot;,
    &quot;_type&quot;: &quot;result&quot;,
    &quot;_id&quot;: &quot;fY1Amn4BTPepfjg1c5x5&quot;,
    &quot;_version&quot;: 1,
    &quot;_score&quot;: 1,
    &quot;_source&quot;: {
      &quot;timeStamp&quot;: &quot;2022-01-27T14:37:01+08:00&quot;,
      &quot;test&quot;: &quot;EOL_Overall_test_result&quot;,
      &quot;hostname&quot;: &quot;eol-test-0&quot;,
      &quot;acdID&quot;: &quot;0x00A2F16A&quot;,
      &quot;EESWVer&quot;: &quot;0.3.0&quot;,
      &quot;device&quot;: &quot;&quot;,
      &quot;result&quot;: &quot;PASS&quot;,
      &quot;reason&quot;: &quot;0b001111111110011011111111&quot;,
      &quot;board&quot;: &quot;JENMUL90&quot;
    },
    &quot;fields&quot;: {
      &quot;acdID.keyword&quot;: [
        &quot;0x00A2F16A&quot;
      ],
      &quot;reason&quot;: [
        &quot;0b001111111110011011111111&quot;
      ],
      &quot;device.keyword&quot;: [
        &quot;&quot;
      ],
      &quot;test&quot;: [
        &quot;EOL_Overall_test_result&quot;
      ],
      &quot;test.keyword&quot;: [
        &quot;EOL_Overall_test_result&quot;
      ],
      &quot;result.keyword&quot;: [
        &quot;PASS&quot;
     ],
      &quot;EESWVer.keyword&quot;: [
       &quot;0.3.0&quot;
      ],
      &quot;board.keyword&quot;: [
        &quot;JENMU90&quot;
      ],
      &quot;result&quot;: [
        &quot;PASS&quot;
      ],
      &quot;timeStamp&quot;: [
       &quot;2022-01-27T06:37:01.000Z&quot;
      ],
      &quot;hostname&quot;: [
        &quot;eol-test-0&quot;
      ],
      &quot;reason.keyword&quot;: [
       &quot;0b001111111110011011111111&quot;
      ],
      &quot;acdID&quot;: [
        &quot;0x00A2F16A&quot;
      ],
      &quot;EESWVer&quot;: [
        &quot;0.3.0&quot;
      ],
      &quot;hostname.keyword&quot;: [
        &quot;eol-test-0&quot;
      ],
      &quot;device&quot;: [
        &quot;&quot;
      ],
      &quot;board&quot;: [
        &quot;JENMUL90&quot;
      ]
    }
  }
  </code></pre>