Skip to content
unlob

prefer_recent

boolean

Biases ranking toward newer passages without excluding older ones.

A soft preference rather than a filter. Where published_from removes everything older than a date, prefer_recent keeps it available but ranks it lower — which is the right behaviour when old material is still valid, just less likely to be what was wanted.

Example

prefer_recentbash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/search?q=react+best+practices&prefer_recent=true"

Common questions

What does the prefer_recent filter do?

Biases ranking toward newer passages without excluding older ones.

When should I use prefer_recent?

Recency matters but is not a hard requirement.

Filters are free

Every filter is evaluated against a stored field, so it narrows the candidate set before scoring — a filtered query is often faster than an unfiltered one.