I have been reading this and I was a bit confused. If I create an index on a bucket, I don’t have to call that specific index that I created, it’s done automatically indexed for future querying? also, this is what’s in my bucket.
[
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 0.34092514802274876,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:00.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "179933509776140"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 4,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:02.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "179933509776140"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 0.34092514802274876,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:02.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "179933509776140"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 4,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:02.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "2323"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 4,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:02.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "179933509776140"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"bluetoothAddress": "0C:F3:EE:08:A6:A3",
"bluetoothName": "EMBeacon00000",
"id1": "0x699ebc80e1f311e39a0f",
"id2": "0x0cf3ee3bc018",
"id3": "0x699ebc80e1f311e39a0f",
"manufacturer": 65194,
"receiverId": "42008780c4b9b329",
"serialNumber": "179933509776140",
"serviceUuid": 65194
},
"expiry": 0,
"id": "BeaconList",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"bluetoothAddress": "0C:F3:EE:08:A6:A3",
"bluetoothName": "EMBeacon00000",
"id1": "0x699ebc80e1f311e39a0f",
"id2": "0x0cf3ee3bc018",
"id3": "0x699ebc80e1f311e39a0f",
"manufacturer": 65194,
"receiverId": "42008780c4b9b329",
"serialNumber": "2323",
"serviceUuid": 65194
},
"expiry": 0,
"id": "BeaconList",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"assignedDate": "2003-02-17T09:10:33",
"serialNumber": "222",
"uldNumber": "2"
},
"expiry": 0,
"id": "BeaconLink",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"assignedDate": "2003-02-17T09:10:00",
"serialNumber": "999",
"uldNumber": "2"
},
"expiry": 0,
"id": "BeaconLink",
"token": null
}
},
{
"BeaconBucketOne": {
"cas": 0,
"content": {
"distance": 0.34092514802274876,
"distanceTesting": 0.25,
"newDistance": 0.19106446691360568,
"receivedDate": "2017-03-20T11:31:01.279968-04:00",
"receiverId": "42008780c4b9b329",
"rssi": -50,
"serialNumber": "179933509776140"
},
"expiry": 0,
"id": "BeaconInfo",
"token": null
}
}
]
I have 3 types in this document(assigned in Id)- BeaconLink, BeaconInfo, and BeaconList. I want to index them so querying is optimized. Is the best way to do that by using CREATE INDEX content ON ``BeaconBucketOne``(content);
and making another index on id? If I use a query like, string query = "SELECT content.assignedDate,content.serialNumber,content.uldNumber FROM ``BeaconBucketOne`` WHERE id = 'BeaconLink'";
I am getting the results that I want but I’m not sure if I’m doing it in an optimized way. Thank you.