# Chapter 7: Compilation Error on filter and group filter

**URL:** <https://forums.kodeco.com/t/chapter-7-compilation-error-on-filter-and-group-filter/48711>\
**Category:** Server Side Swift with Vapor\
**Created:** [September 9, 2018, 6:56pm UTC](https://forums.kodeco.com/t/chapter-7-compilation-error-on-filter-and-group-filter/48711 "2018-09-09T18:56:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joesludge](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/joesludge/32/102075_2.png) [@joesludge](https://forums.kodeco.com/u/joesludge)\
**Post date:** [September 9, 2018, 6:56pm UTC](https://forums.kodeco.com/t/chapter-7-compilation-error-on-filter-and-group-filter/48711/1 "2018-09-09T18:56:59Z")

</div>

In Chapter 7, in the part where it talks about using filter group to apply a search term to more than one property, I’m getting a compilation error, “Type of expression is ambiguous without more context”. I do not understand this. Everything has worked fine up to the filter examples. Here is the complete code for the route:

```auto
    router.get("api", "acronyms", "search") { req -> Future<[Acronym]> in
        guard let searchTerm = req.query[String.self, at: "term"] else {
            throw Abort(.badRequest)
        }
        return Acronym.query(on: req).group(.or) { or in
            or.filter(\.short == searchTerm)
            or.filter(\.long == searchTerm)
            }.all()
    }

```

A similar issue also happens with the previous single filter example. The complier appears to be complaining about the back slash.

---

<div class="post-metadata">

**Author:** ![joesludge](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/joesludge/32/102075_2.png) [@joesludge](https://forums.kodeco.com/u/joesludge)\
**Post date:** [September 9, 2018, 7:15pm UTC](https://forums.kodeco.com/t/chapter-7-compilation-error-on-filter-and-group-filter/48711/2 "2018-09-09T19:15:18Z")

</div>

I found the answer. I missed a little part in the setup code where we needed to import Fluent. Derp!

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [September 30, 2018, 12:34pm UTC](https://forums.kodeco.com/t/chapter-7-compilation-error-on-filter-and-group-filter/48711/3 "2018-09-30T12:34:14Z")

</div>

@joesludge Glad you managed to sort it out. Cheers! :]
