---
updatedAt: 2025-05-15T07:49:00.000Z
agentTools:
  projectIndex: https://developer.boodskap.io/llms.txt
---

# Elastic Context

* A very handy API handle to perform various analytical search operations across different data models of the platform

* Platform has exposed a variety of data models to build your IoT solution effortless and elegantly. This single interface allows you to manage those entity objects.

* Context Variable: <span style={{ color: "teal" }}>**elastic**</span>

## Meta Models (Search Types)

|                              |                               |                            |
| :--------------------------: | :---------------------------: | :------------------------: |
|          **MESSAGE**         |           **RECORD**          |        NOTIFICATION        |
|      **DOMAIN\_RECORD**      |       **SYSTEM\_RECORD**      |     **GLOBAL\_RECORD**     |
|            ACCESS            |             ALEXA             |            ASSET           |
|         ASSET\_GROUP         |             AUDIT             |           COMMAND          |
|       CONNECTION\_POOL       |          DB\_METADATA         |        DB\_TEMPLATE        |
|            DEVICE            |         DEVICE\_GROUP         |        DEVICE\_MODEL       |
|            DOMAIN            |      DOMAIN\_ASSET\_GROUP     |    DOMAIN\_DEVICE\_GROUP   |
|      DOMAIN\_USER\_GROUP     |  DOMAIN\_USER\_GROUP\_MEMBER  |            EMAIL           |
|             EVENT            |      EVENT\_REGISTRATION      |             FCM            |
|          FCM\_DEVICE         |              FILE             |        FILE\_PUBLIC        |
|           FIRMWARE           |            GEOFENCE           |           GROOVY           |
|          GROOVY\_JAR         |            LOCATION           |      LOCATION\_HISTORY     |
|            OBJECT            |             PLUGIN            |       PUBLIC\_GROOVY       |
|      PUBLIC\_GROOVY\_JAR     |      PUBLIC\_NOTIFICATION     |             LOG            |
|       REPORTED\_DEVICE       |         RULE\_FAILURE         |           SCREEN           |
|        SCREEN\_VERSION       |        SCREEN\_IMPORTED       |             SMS            |
|          SQL\_TABLE          |         SQL\_TEMPLATE         |            USER            |
|      USER\_ASSET\_GROUP      |      USER\_DEVICE\_GROUP      |         USER\_GROUP        |
|           VERTICAL           |       VERTICAL\_IMPORTED      |     VERTICAL\_PUBLISHED    |
|       VERTICAL\_VERSION      |             VOICE             |           WIDGET           |
|       WIDGET\_IMPORTED       |       WIDGET\_PUBLISHED       |       WIDGET\_VERSION      |
|            BILLING           |            CONTACT            |           INVOICE          |
|       BILLING\_TEMPLATE      |         SENT\_COMMAND         |            ROLE            |
|          USER\_ROLE          |      ASSET\_GROUP\_MEMBER     |    DEVICE\_GROUP\_MEMBER   |
| DOMAIN\_ASSET\_GROUP\_MEMBER | DOMAIN\_DEVICE\_GROUP\_MEMBER | USER\_ASSET\_GROUP\_MEMBER |
|  USER\_DEVICE\_GROUP\_MEMBER |      USER\_GROUP\_MEMBER      |        ORGANIZATION        |
|      ORGANIZATION\_ROLE      |    ORGANIZATION\_USER\_ROLE   |    ORGANIZATION\_DEVICE    |
|      ORGANIZATION\_ASSET     |       ORGANIZATION\_USER      | ORGANIZATION\_USER\_DEVICE |
|   ORGANIZATION\_USER\_ASSET  |            PROCESS            |          WORKFLOW          |
|      WORKFLOW\_INSTANCE      |        GLOBAL\_PROCESS        |      GLOBAL\_WORKFLOW      |
|  GLOBAL\_WORKFLOW\_INSTANCE  |          SFTP\_INPUT          |      ORG\_SFTP\_INPUT      |
|      GLOBAL\_SFTP\_INPUT     |      SYSTEM\_SFTP\_INPUT      |         MQTT\_INPUT        |
|       ORG\_MQTT\_INPUT       |      GLOBAL\_MQTT\_INPUT      |     SYSTEM\_MQTT\_INPUT    |
|          UDP\_INPUT          |        ORG\_UDP\_INPUT        |     GLOBAL\_UDP\_INPUT     |
|      SYSTEM\_UDP\_INPUT      |           TCP\_INPUT          |       ORG\_TCP\_INPUT      |
|      GLOBAL\_TCP\_INPUT      |       SYSTEM\_TCP\_INPUT      |        EMAIL\_INPUT        |
|       ORG\_EMAIL\_INPUT      |      GLOBAL\_EMAIL\_INPUT     |    SYSTEM\_EMAIL\_INPUT    |

## API Interface

```groovy
// Search operation
public Map<String, Object> search(String type, String query);

// Search using template operation
public Map<String, Object> search(String type, String template, Map<String,Object> params);
	
// Count operation
public Map<String, Object> count(String type, String query);

// Count using template operation
public Map<String, Object> count(String type, String template, Map<String,Object> params);
	
// Find operation
public Map<String, Object> find(String type, String query);

// Find using template operation
public Map<String, Object> find(String type, String template, Map<String,Object> params);
	
// Merge operation
public Map<String, Object> merge(String type, Map<String,Object> fields);
	
// Merge operation
public Map<String, Object> merge(String type, JSONObject jsonObj);
	
// Merge operation
public Map<String, Object> merge(String type, Object bean);
	
// Merge operation
public Map<String, Object> merge(String type, String jsonStr);

// Merge using template operation
public Map<String, Object> merge(String type, String template, Map<String,Object> params);
	
// Purge operation
public Map<String, Object> purge(String type, String query);

// Purge using template operation
public Map<String, Object> purge(String type, String template, Map<String,Object> params);
	
// Remove operation
public Map<String, Object> remove(String type, String query);

// Remove using template operation
public Map<String, Object> remove(String type, String template, Map<String,Object> params);
	
// Scroll operation
public Map<String, Object> scroll(String type, String query);
	
// Scroll using template operation
public Map<String, Object> scroll(String type, String template, Map<String,Object> params);
	
// List available search types
public List<String> types();

// Required for MESSAGE & RECORD types
public void setSpecId(Long specId);

// Required for MESSAGE & RECORD types
public void setSpecId(String specId);

// Requires for Merge operation
public void setEntityId(String entityId);

// Extra search path
public void setExtraPath(String extraPath);

// Extra query parameters
public void setQueryParams(Map<String, String> queryParams);
```

## APIs Inherited From

[Context Base](https://developer.boodskap.io/docs/context-base)

## Related REST APIs

[Search By Query](https://developer.boodskap.io/reference/searchbyquery)

[Search by Template](https://developer.boodskap.io/reference/searchbytemplate)

[Count By Query](https://developer.boodskap.io/reference/countbyquery)

[Find By ID](https://developer.boodskap.io/reference/findbyid)

[Merge By ID](https://developer.boodskap.io/reference/mergebyid)

[Update By Query](https://developer.boodskap.io/reference/updatebyquery)

[Update by Template](https://developer.boodskap.io/reference/updatebytemplate)

[Remove By ID](https://developer.boodskap.io/reference/removebyid)

[Purge](https://developer.boodskap.io/reference/purge)

[Purge by Template](https://developer.boodskap.io/reference/purgebytemplate)

[Scroll previous result set](https://developer.boodskap.io/reference/scrollresults)