For example: The following configuration:
When given the following REST payload:
The above config will turned a REST payload into a Document with the following Field:
- name: uuid, value: xyz
- name: name, value: Example of Cohort
In addition, the Search API also adds some default fields:
- name: json, value: the full JSON payload (this one will be used by the algorithm to return the correct object).
- name: class, value: the name of the class to which the JSON can be converted into.
- name: resource, value: the resource descriptor's name.
The above "class" field can be used to query the Lucene to get all object for a particular type. The class field query combined with other field query will allow you to query for an object with certain value in one of the field. For example, if we want to get the above object, we would send the following query:
In the mUzima API, the above query will be hidden behind the