# How to leave a search route free

A Node route can stay free even if you mapped it under the `search` class. Set `cost: 0` on that route in `attackfee.yaml`. The example file notes this option on a `/search` rule. Any other `cost` value is refused. If you leave `cost` out, the route uses the class default.

Use this when a posted search should not require a pass. Search is a priced class by default, because a query can cost you per call. If that is not true for a given route, `cost: 0` leaves it free. Do not use this as a way to gate page views. Keep `/` as `class: read`, and leave `confirm_page_view_gating` off.

If the route is free, do not require a pass on the form that posts to it. Mark and check only the routes you mean to price. People never pay money. Reads stay free.

## Where Attackfee fits

This is a route-level exception, not a new class. See [How to mark which routes are writes](/learn/concepts/how-to-mark-routes), [What are Attackfee action classes?](/learn/concepts/action-classes), and [Why a posted search query is a write](/learn/write-surfaces/posted-search-is-a-write).

- [Attackfee](/)
- [Learn](/learn)
- [Concepts](/learn/concepts)
- [How to leave a search route free](/learn/concepts/how-to-leave-a-search-route-free)

## Related

- [How to mark which routes are writes](/learn/concepts/how-to-mark-routes)
- [What are Attackfee action classes?](/learn/concepts/action-classes)
- [What attackfee.yaml configures](/learn/concepts/what-attackfee-yaml-configures)
- [Why a posted search query is a write](/learn/write-surfaces/posted-search-is-a-write)
- [How to protect a search field from bots](/learn/write-surfaces/how-to-protect-a-search-field)
- [Why page-view gating should stay off](/learn/limits/why-page-view-gating-should-stay-off)
- [Server](/docs/server)

## Questions



### "What values can cost take?"

"Only 0, which leaves that route free. Leave the key out to use the class default. Any other number is refused."

### "Should I do this for page views?"

"No. Keep / as class read so GET stays free. Do not turn on confirm_page_view_gating."

### "When would I use this?"

"When a posted search should stay free, even though the search class would otherwise price it."

### "Does this change the form attribute?"

"If the route is free, you should not require a pass on that post. Only mark and check the routes you mean to price."
