Description
This article explains how to use the Search Entities API (POST /entities/search) to locate Experiments in Signals Notebook that meet specific criteria, particularly those with a specific value in a designated Field of Experiment.
Solution
To find Experiments with a particular value in a specific field, you can utilize the Search Entities API. Here's an example of how to find Experiments where the "Department" field has the value "Biology":
Use the POST /entities/search with the following request body.
{
"query": {
"$and": [
{
"$match": {
"field": "type",
"value": "experiment",
"mode": "keyword"
}
},
{
"$match": {
"field": "fields.Department",
"value": "Biology",
"in": "tags",
"mode": "keyword"
}
}
]
}
}
This query does two things:
- It filters for entities of type "experiment".
- It searches for experiments where the "Department" field contains the value "Biology".
Note: The "in": "tags" parameter specifies that the search should look in the tags associated with the field.