So, let's talk about indexing.
Imagine a database with the following documents in:
{ "name": "Stuart", "address": {"town": "Birmingham", "country": "UK"},
"hair": "red", "colours": [ "red", "blue" ], "id": "sil" }
{ "name": "Samuele", "address": {"town": "Sometown", "country": "CH"},
"hair": "brown", "colours": [ "green" ], "id": "pedronis" }
{ "name": "Lucio", "address": {"town": "Othertown", "country": "AR"},
"hair": "brown", "colours": [ "pink" ], "id": "lucio" }
{ "name": "Rodney", "address": {"town": "Podunk", "country": "US"},
"hair": "brown", "colours": [ "brown", "red" ], "id": "dobey" }
If I create an index as create_index("haircolour", ["hair"]), the index
would look (conceptually) like this:
brown: dobey
brown: lucio
brown: pedronis
red: sil