Skip to content

Update multi-value-esql-controls.md#5689

Merged
mjmbischoff merged 5 commits into
mainfrom
mjmbischoff-doc-patch-mv-controls
Apr 20, 2026
Merged

Update multi-value-esql-controls.md#5689
mjmbischoff merged 5 commits into
mainfrom
mjmbischoff-doc-patch-mv-controls

Conversation

@mjmbischoff
Copy link
Copy Markdown
Contributor

Summary

Param order addressed(otherwise docs with null value in field are always returned), adding reference to MV_INTERSECTS for any vs all semantics.

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No

Param order addressed, adding reference to MV_INTERSECTS for any vs all semantics.
@mjmbischoff mjmbischoff requested review from a team as code owners March 31, 2026 08:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@mjmbischoff mjmbischoff enabled auto-merge (squash) March 31, 2026 08:49
@mjmbischoff mjmbischoff disabled auto-merge March 31, 2026 10:40
@mjmbischoff
Copy link
Copy Markdown
Contributor Author

#5684 already addresses the param order.

@mjmbischoff mjmbischoff enabled auto-merge (squash) March 31, 2026 10:44
Copy link
Copy Markdown
Member

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one language suggestion :)

Comment thread explore-analyze/_snippets/multi-value-esql-controls.md Outdated
@florent-leborgne
Copy link
Copy Markdown
Member

Hey, @mjmbischoff, thanks for the addition there. Since this section is explicitly about how to enable variable controls that can accept multiple values, are we saying that MV_INTERSECTS now also allows this? My initial understanding was that only MV_CONTAINS allowed this (unless there has been some recent development I haven't caught up on yet). CC @stratoula can you confirm?


2. When defining the control, select the **Allow multiple selections** option.
:::{note}
[`MV_CONTAINS`](elasticsearch://reference/query-languages/esql/functions-operators/mv-functions/mv_contains.md) will check if _all_ values are present, use [`MV_INTERSECTS`](elasticsearch://reference/query-languages/esql/functions-operators/mv-functions/mv_intersects.md) if you want _any_ present semantics.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Can you explain to me which is the difference between MV_CONTAINS with the MV_INTERSECTS we want to add here?

Copy link
Copy Markdown
Contributor Author

@mjmbischoff mjmbischoff Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one checks if all values are present in the field, the other will return true if any values are present.

So if you have a field with for example cloud provider [AWS, AZURE, GCP] you can ask "give me all services deployed in AWS and AZURE" vs "Give me all services in AZURE or GCP"

PUT services
{
    "mappings": {
        "properties": {
            "name": {
                "type": "keyword"
            },
            "location": {
                "properties": {
                    "cloud": {
                        "type" : "keyword"
                    }
                }
            }
        }
    }
}


PUT services/_doc/a
{
  "name": "service A",
  "location" : {
    "cloud": ["AZURE", "AWS", "GCP"]
  }
}
PUT services/_doc/b
{
  "name": "service B",
  "location" : {
    "cloud": ["AZURE", "AWS"]
  }
}
PUT services/_doc/c
{
  "name": "service C",
  "location" : {
    "cloud": [ "AWS", "GCP"]
  }
}
PUT services/_doc/d
{
  "name": "service D",
  "location" : {
    "cloud": ["AZURE", "GCP"]
  }
}
PUT services/_doc/e
{
  "name": "service E",
  "location" : {
    "cloud": ["AZURE"]
  }
}

POST services/_refresh

POST _query?format=txt
{
  "query": """
    FROM services 
    | WHERE MV_CONTAINS(location.cloud, ["AZURE","AWS"])
  """
}

/*
#! No limit defined, adding default limit of [1000]
 location.cloud  |     name      
-----------------+---------------
[AWS, AZURE, GCP]|service A      
[AWS, AZURE]     |service B         
*/

POST _query?format=txt
{
  "query": """
    FROM services 
    | WHERE MV_INTERSECTS(location.cloud, ["AZURE","AWS"])
  """
}

/*
#! No limit defined, adding default limit of [1000]
 location.cloud  |     name      
-----------------+---------------
AZURE            |service E      
[AWS, AZURE, GCP]|service A      
[AWS, AZURE]     |service B      
[AWS, GCP]       |service C      
[AZURE, GCP]     |service D     
*/
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm both support multi values variables. So it is ok to update the docs but also this:

image

@mjmbischoff
Copy link
Copy Markdown
Contributor Author

I guess the note here should also be updated in a separate PR:

image

Improving wording

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
@mjmbischoff
Copy link
Copy Markdown
Contributor Author

Hey, @mjmbischoff, thanks for the addition there. Since this section is explicitly about how to enable variable controls that can accept multiple values, are we saying that MV_INTERSECTS now also allows this? My initial understanding was that only MV_CONTAINS allowed this (unless there has been some recent development I haven't caught up on yet). CC @stratoula can you confirm?

Yes, the variable will start emitting multi values, so any function that takes multi values could be used.

So usefulness aside, you can use MV_COUNT for example:
image

Copy link
Copy Markdown
Member

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mjmbischoff mjmbischoff merged commit cc737d1 into main Apr 20, 2026
6 checks passed
@mjmbischoff mjmbischoff deleted the mjmbischoff-doc-patch-mv-controls branch April 20, 2026 09:39
@florent-leborgne
Copy link
Copy Markdown
Member

@mjmbischoff @stratoula for the UI message update: elastic/kibana#264353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants