An Empty Query and a Query with No Matches
A search interface can display browse options for an empty query and a useful no-results state for a supplied query with no matching documents.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace two URL states
Opening a catalogue without q can show recent or organized entries. Searching for a known absent label asks a different question. Web query state distinguishes those inputs.
Keep re-entry easy
Preserve the query in the input after no matches so the reader can correct it. Empty collections and missing resources provide the corresponding outcome distinction.[1]
Distinguish entry conditions from a completed search
A blank input can mean no search was requested. A nonempty query may execute successfully and return no matches. A rejected query can have a third status, such as unsupported syntax. Each outcome needs its own treatment. See empty lists and missing resources.
Empty query → default or instruction state
Valid query with no hits → empty search result
Invalid query → documented error
Check normalized emptiness as well as raw input
Text containing only spaces can become empty after trimming. Some tokenization rules remove every term from a nonempty query. Test both cases and verify the behavior the application advertises.