Searching

How a typed search becomes one request to your index, and why nothing you type can change the query.

Search goes straight from the app to the phone's index, in a single request. What you type can match the words a photo was read into, and on plans with vector search, what your words mean.

YOU TYPE dog on the beach plus any filters embed api.opensolr.com words to a query vector vector search plans only One POST to /select lex: edismax on the words vec: knn on the embeddings q: bool of lex and vec fq: year, folder, camera facets feed the filters Photo grid tap: gallery app hold: details What you type only travels as the bound parameter uq, and every filter value through {!term} with a bound value, so no input can change the query itself. Empty search box: every photo, newest first. No vector search on the plan, or its AI requests used up: the same request without vec, and the app says so above the results.

Figure 1 — a typed search, an optional query vector, one POST to the index, results that open in the gallery.

01 · The empty search box

With nothing typed, the grid lists every photo in the index, newest first (q=*:*, sorted by the date taken). This is what you see when the app opens.

02 · Words

What you type is trimmed to 300 characters and sent only as the bound parameter uq. The query that uses it is fixed in the app:

uq = dog on the beach lex = {!edismax qf='meaning^3 text file_name_text folder_text camera_text' mm=1 v=$uq}

meaning holds the words CLIP read the photo into and weighs the most. text also collects the file name, the folder, the camera, and the place the photo was taken in (city, region, country), so typing screenshots, pixel or Bucharest finds what you would expect. Words are matched with stemming and accent folding, so dogs finds dog and bucuresti finds Bucureşti.

02b · Autocomplete

From the second character on, a short list appears under the search box: the words your own photos were read into, the camera makes and models, and the places they were taken in, all of them matched anywhere in the term (cat offers tabby cat). Tap one and it searches. The list comes from the index's /suggest handler, a Solr suggester built from the suggest field and rebuilt at every commit, so a photo that was just indexed is offered right away.

02c · Did you mean

Every typed search is also spellchecked against the same words, camera names and places (the spell field, checked by Solr's DirectSolrSpellChecker). When a correction exists, Did you mean briefcase? appears above the results, one tap away. Only the words your photos actually carry can be suggested: the dictionary is your index, nothing else.

03 · Meaning

On a plan with vector search, the app first asks Opensolr's embed endpoint to turn your words into a query vector, then adds it next to the words:

vec = {!knn f=embeddings topK=60}[0.0132, -0.0481, ...] q = {!bool should=$lex should=$vec}

A photo can be found by the words, by the meaning, or by both, and the ones that match both rank highest. The line above the results says matched by meaning and words when the vector was used.

When meaning is not available

Without vector search on the plan, when this month's AI requests are used up, or when the vector service does not answer, the same request runs with words only, and a note above the results says why.

04 · Why nothing you type can change the query
  • Your text only ever travels in uq, read by the query through v=$uq. It is never pasted into the query syntax, so characters such as braces, colons or quotes are just characters.
  • Every filter value travels the same way, through the term parser with a bound value (see filters).
  • Page size is clamped and the start offset cannot be negative.
  • The request is a POST: a query vector is too long for a URL, and a request body keeps what you searched for out of server access logs.
05 · Results

Results come 60 at a time and more load as you scroll. The thumbnails are drawn from the photos on your phone; nothing is downloaded to show the grid. Tapping and holding a photo is described in filters & photo details.

  • Enter on the keyboard runs the search.
  • Reload: swipe down on the grid, or tap the reload icon next to the photo count, to read the results again from the index — for photos a sync added in the meantime. Coming back to the photos from the Sync or Account screen reloads them as well.
  • The map icon at the top opens the map with the photos of the current search that carry a place.

Opensolr Photos is open source and MIT licensed. Questions about your Opensolr account, index or plan go to opensolr.com/contact; questions about the app itself belong on GitHub.

Opensolr Photos Documentation