How Loosen works
An empty result is not a dead end if you can say why it is empty and what is the smallest change that fixes it. That is all Loosen does, exactly and fast.
An example: a used car
A visitor looks for a car with these filters (this example is from the thesis behind Loosen):
price ≤ 6,500 EUR AND mileage ≤ 50,000 km AND colour = blue AND airbag = yes → 0 cars
A normal catalogue shows an empty list. Loosen shows three complementary things.
1. Conflicts: why there is nothing
A conflict is a minimal group of filters that cannot be satisfied together: remove any one filter of the group and some cars match. There can be several, and they overlap:
- There are no cars with price ≤ 6,500 and mileage ≤ 50,000.
- There are no cars either with price ≤ 6,500 and blue and airbag.
Notice what this tells the visitor: colour and airbag are not the problem on their own. It is the budget against the mileage, and the budget against that particular combination.
2. Local relaxations: how to fix one conflict
For each conflict, the smallest changes that dissolve it by themselves. To solve the first conflict: raise the price cap to 9,238 EUR (instead of 6,500) or raise the mileage cap to 55,700 km (instead of 50,000). For a numeric filter Loosen does not just say “relax the price”: it computes the exact bound that is enough. These local suggestions sit behind a collapsed “Why?” button and carry no result count: they fix one conflict only, and other filters may still stand in the way of the whole query.
3. Global relaxations: how to get results at all
The non-dominated changes that make the whole query succeed. Each is shown with how many results it gives (“price ≤ 9,238 · N results”), cheapest change first. Here:
- price ≤ 9,238
- mileage ≤ 55,700 and drop the colour
- mileage ≤ 76,000 and drop the airbag
Each is one click, and the visitor sees what they get before clicking. Cheapest first means the smallest move of a bound comes first (as a fraction of the range of the attribute in your data), and dropping a filter costs more than any move; the count is the number of items matching the whole query after the change. If it was not what the visitor wanted, an Undo button puts the filters back as they were, and while they hover over a suggestion your page can highlight the filters it would change. Only the useful alternatives are shown: no suggestion contains a smaller one, and at most one filter has its bound moved. In the study behind Loosen, 84% of these lists had five suggestions or fewer.
Why people trust it
The thesis argues that what makes people act on a recommendation is confidence, and that explanations build it when they are:
- Constraint-based: they talk about the visitor's own filters.
- Universally valid: a conflict is a fact about your catalogue; it stays true whatever else the visitor changes.
- Negatory: they explain what is not in the catalogue, which a ranked list never does.
- Unique: the same query always gets the same explanation.
A visitor can tell a friend “there is nothing cheaper unless you pay 2,700 more”, and check it. They cannot justify “the system gave it 90%”.
“At least n results”: not only when it is empty
Empty is the clearest case, but a visitor comparing options may want at least three, or five. Set minItems: 3 and Loosen acts whenever fewer than 3 items match, with the same three parts: the conflicts are the groups of filters that fewer than 3 items satisfy together, and every relaxation is computed to give at least 3 results.
Example, on the apartments of the demo: rent ≤ 1200 CHF and rooms ≥ 3 match exactly one apartment, so by default nothing is shown. With minItems: 3 the panel says “Any of these changes gives at least 3 results” and offers Rent ≤ 1380 CHF · 3 results and Rooms ≥ 2 · 40 results. The new bound, 1380, is the third best rent among the apartments with three rooms or more: the smallest move that really gives 3, not a guess.
Set it yourself, or let the visitor choose with userMinItems (“Warn me if fewer than [N] results”, remembered in their browser). 1 is right for “no dead ends”; 3 to 5 for catalogues people browse. If the catalogue has fewer than n items nothing can help, so nothing is shown. The search for tradeoffs grows quickly with the size of the group of filters, so maxSize caps it (3 by default) and matters more as n grows: visitors rarely build conflicts of more than three or four filters, and the cap keeps the answer in milliseconds. Install guide, section 5.8.
Updates
Nothing is precomputed: every explanation is derived from the catalogue as it is now, so it cannot go stale.
- Browser mode: the widget analyses the items in the page. When your data changes, call
setData(rows). - Server mode:
loosendkeeps your catalogue in memory. Feed it from a CSV or JSON URL every few minutes, or push single changes through the API (one upsert costs less than a millisecond at 100,000 items). It writes snapshots, so a restart keeps the data.
The analysis is exact (not a guess or a model), and a catalogue of 10,000 items answers in about a millisecond.
The panel speaks the language of your page: eight languages are built into the widget, with nothing to configure.
Want to see every integration form working? Live demo, or run the open-source examples on your own machine (186 apartments).