Creating specific form action

I want my form to route to something like this upon submit:

www.example.com/search/form+input+field

Currently it sends to www.example.com/search/q=form+input+field

This is what my form looks like:

    <form action="<?php $this->Url->build(['controller' => 'search']); ?>" method="get" class="sidebar-form">
        <div class="input-group">
            <input type="text" name="q" class="form-control" placeholder="Search...">
            <span class="input-group-btn">
                <button type="submit" id="search-btn" class="btn btn-flat">
                    <i class="fa fa-search"></i>
                </button>
            </span>
        </div>
    </form>