Every phone gets one Opensolr Index of its own, in your account. The app finds it, creates it or creates it again, and only ever creates one when it is certain it is missing. The phone also keeps its own copy of what that index holds.
Figure 1 — the life of the phone's index: found and reused, or created when it is certainly missing, and the one read that fills the phone's copy of it.
The index is named photos_<ANDROID_ID>__dense. ANDROID_ID is the identifier Android gives this app on this phone: it stays the same when the app is reinstalled, and it is different on every other phone.
Reinstall on the same phone
Sign in, and the app finds the index by its name. Nothing is indexed again, but this is the one moment the whole index is read down, once, to rebuild the phone's copy of it; after that a Re-Sync adds and deletes the differences.
A new phone, same account
A different ANDROID_ID, so a different name. Before creating anything, the app asks Re-use one of these indexes from your Opensolr account?, listing the phones that already have photos in the account: pick the one this phone used to be (after a reset, or a replacement with the same photos) and it carries on with those, every photo keeping its identity because its id is its path inside the phone's storage; or No, start a new index. Picking an existing one triggers the same single read of that index into this phone's copy.
The name is decided once and remembered on the phone (the one created here, or the one picked as this device). Every photo index carries the phone it was created for, which is what the question shows. Phones that stop syncing are covered in phones you no longer use.
When the name is in the account's index list, the app reads the index's address and password and compares the configuration version the index runs with the one the app ships. Equal: the sync goes on. Older: you are asked to agree to a reset, see a new index configuration. Newer: the app asks to be updated and leaves the index alone. The app never deletes an index; a reset empties it and fills it again from the phone's copy, with no photo sent again.
The phone keeps a copy of everything the index holds except the search vector and the keys for similar photos. It is read from the index once, kept in step by every write, and is what the index is filled back from. It has its own page: the phone's copy of the index.
- Pick the nearest region. Opensolr marks the region nearest to where the phone connects from, among the regions that run the app's configuration, and the app takes it. Nothing is asked and nothing is shown. See vector_regions.
- Create the index with that name in that environment.
- Upload the configuration that ships inside the app:
schema.xml,solrconfig.xmland the analyzer files. - Wait until it answers with the new schema. Right after a create the index needs a few seconds to reload and apply its password and firewall rule; the app waits that out instead of mistaking it for an error.
This is the same on every plan. A plan without vector search still gets the same index on an environment that runs vector search, with the same schema; the plan decides only what is put in it. Without vector search no photo is read, so the vector field stays empty and the photos are indexed by their dates, camera, place, file name and your own words.
An index deleted from the control panel, removed as unused, or gone for any other reason is noticed at the next sync and created again the same way, empty; the Sync screen says Index recreated. The same sync then finds the index empty while the phone's copy is not, and fills it back from the copy: no photo is read again, and your tags, people and wording come back with it.
An index is only created after the account's index list was read successfully and did not contain it. A network error, a server error or a refused key never lead to a create: they end the run, and the next sync — forced, scheduled, or started by pulling the photo grid down — simply tries again.
It is a regular Opensolr Index. Open it from the app's Me screen or from the control panel to query it, back it up or empty it.
It is plain Apache Solr: query it or export every document with any Solr client, back it up, and run it anywhere. Changing it from outside the app is the one thing to be careful with: edits made to documents from the control panel or any other tool do not reach the phone's copy.
- Emptied from anywhere, including the control panel: the next sync finds the index empty while the phone's copy holds the photos, and fills it back from the copy.
- Reset on the Sync screen does the same on purpose: it empties the index and fills it again from the copy on the phone.
- Re-read leaves the index as it is and writes every photo over what is there, which is enough when the index still holds its documents and only their contents are wrong.
- Deleting the index from the control panel is noticed (see above): it is created again and filled from the phone's copy.
How it works
- How it works
- The phone's index
- The Solr schema