To index field as date.
Document:
{
"title": "Alice in Wonderland",
"year": "1865",
"date": "1865-01-01T00:00:00Z,
"content": "Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do."
}
date field indexed as text.
{
"title": "Alice in Wonderland",
"year": "1865",
"date": {"_datatype_":"http://www.w3. org/2001/XMLSchema#date", "_value_": "1865-01-01T00:00:00Z"},
"content": "Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do."
}
date field indexed as date and you can query like:
{
"node" : {
"attribute": "date",
"query" : "xsd:date([NOW-10YEARS TO NOW])"
}
}
JOIN
fl=xxx,yyy & {!join from=id to=patient.reference}name.family:JUKS
IN SQL
SELECT xxx, yyy FROM collection1 WHERE patient.reference IN (SELECT id FROM collection1 where name.family = "JUKS")