# How can I define the routes if the query needs more than one parameter?

**URL:** <https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410>\
**Category:** Uncategorized\
**Created:** [May 26, 2014, 1:27am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410 "2014-05-26T01:27:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hwoarangzk](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hwoarangzk](https://discuss.emberjs.com/u/hwoarangzk)\
**Post date:** [May 26, 2014, 1:27am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410/1 "2014-05-26T01:27:51Z")

</div>

```
Let's assume this scenario : there is a list of different goods on the page, and if you want to query a certain good, the type of the good and the first letter of this good's name should be included for the parameters, so how could I define this route to query the good? Many articles introduced dynamic segment in the route, but there is only one parameter(ofter the id of the model) for the query. What's the way to deal with this scenario? Thanks

```

---

<div class="post-metadata">

**Author:** ![ahacking](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@ahacking](https://discuss.emberjs.com/u/ahacking)\
**Post date:** [May 26, 2014, 5:33am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410/2 "2014-05-26T05:33:25Z")

</div>

You need to define `serialize` on your route which can use attributes of the model however you see fit for the route segment parameters you have defined in your router.

Alternatively if you are trying to filter within say an index type route then you can look at Embers query params feature which can be enabled in 1.5 and which are used within your controller.

---

<div class="post-metadata">

**Author:** ![hwoarangzk](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hwoarangzk](https://discuss.emberjs.com/u/hwoarangzk)\
**Post date:** [May 26, 2014, 5:45am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410/3 "2014-05-26T05:45:10Z")

</div>

```
serialize on my route? Could you plz give me a simple example of this? Thanks

```

---

<div class="post-metadata">

**Author:** ![ahacking](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@ahacking](https://discuss.emberjs.com/u/ahacking)\
**Post date:** [May 29, 2014, 3:41am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410/4 "2014-05-29T03:41:02Z")

</div>

The Ember docs are a good place to start. [Route - 4.6 - Ember API Documentation](http://emberjs.com/api/classes/Ember.Route.html#method_serialize)

---

<div class="post-metadata">

**Author:** ![hwoarangzk](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hwoarangzk](https://discuss.emberjs.com/u/hwoarangzk)\
**Post date:** [May 30, 2014, 2:34am UTC](https://discuss.emberjs.com/t/how-can-i-define-the-routes-if-the-query-needs-more-than-one-parameter/5410/5 "2014-05-30T02:34:46Z")

</div>

Thanks 🙂 I’ll take a look at it
