How do I filter by multiple Smart Map addresses? I have profiles (Users) that can have multiple addresses (currently two Smart Map fields called profileAddress1 and profileAddress2).

I know how to filter by a single address:

{% set results = craft.users({
    group: 'profiles',
    profileAddress1: {
        target: 'Cologne',
        range: 20
    }
}) %}


How would I search across both fields? So if a profile had two addresses – one in Cologne and one in Munich – it should show up in the results in both search cases (Cologne and Munich).

Is that even possible?
You would need to setup two criteria models, one for each Smart Map field, and query for the element IDs. Merge these IDs and have a 3rd criteria model where you pass in the IDs to the id parameter.

See this question for example code:  


  Complex logic on a ElementCriteriaModel parameter?


Here's a blog post describing the technique in details:


  Manipulating Craft's ElementCriteriaModel objects with Twig


If you need better performance, have a look at the custom Yii query builder code I posted here:  


  How can I query for entries that have one of two Lightswitch fields enabled?