Paginate with category filter? Below is my paginate code and it's working fine.

{% paginate craft.entries.section('products').limit(9) as entriesOnPage %}

{% for entry in entriesOnPage %}
    &lt;div class="product-box"&gt;
        &lt;div class="product"&gt;
            &lt;p class="product-name"&gt;
                &lt;a href="{{ entry.category.first().url }}"&gt;{{ entry.category.first().title }}&lt;/a&gt;
            &lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
{% endfor %}

{% if paginate.nextUrl %}
    &lt;a href="{{ paginate.nextUrl }}"&gt;Next&lt;/a&gt;
{% endif %}

{% endpaginate %}


Below is my code to display specific category data with pagination. and it's not working.

{% set requestCategory = craft.request.getLastSegment() %}

{% paginate craft.entries.section('products').find({
    search: 'categories:' ~ requestCategory,
  }).limit(9) as entriesOnPage %}

{% for entry in entriesOnPage %}
    &lt;div class="product-box"&gt;
        &lt;div class="product"&gt;
            &lt;p class="product-name"&gt;
                &lt;a href="{{ entry.category.first().url }}"&gt;{{ entry.category.first().title }}&lt;/a&gt;
            &lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
{% endfor %}

{% if paginate.nextUrl %}
    &lt;a href="{{ paginate.nextUrl }}"&gt;Next&lt;/a&gt;
{% endif %}

{% endpaginate %}


i want to add category filter on that but not working how can i add a category filter?
Try using the relatedTo() filter as explained here:

http://buildwithcraft.com/help/entries-related-to-category

{% paginate craft.entries.section('products').relatedTo(requestCategory).limit(9) as entriesOnPage %}