# How can I boost results in relation to the source domain?

**URL:** <https://community.swiftype.com/t/how-can-i-boost-results-in-relation-to-the-source-domain/172>\
**Category:** Setup & Indexing\
**Tags:** api, meta-tags\
**Created:** [April 11, 2016, 4:50pm UTC](https://community.swiftype.com/t/how-can-i-boost-results-in-relation-to-the-source-domain/172 "2016-04-11T16:50:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/swiftype/original/1X/fd652d1735c60057fa71c371375511028f9a1832.png) [@system](https://community.swiftype.com/u/system)\
**Post date:** [April 11, 2016, 4:50pm UTC](https://community.swiftype.com/t/how-can-i-boost-results-in-relation-to-the-source-domain/172/1 "2016-04-11T16:50:47Z")

</div>

> **I’ve created an engine from 3 domains, and I offer a search box on each domain/site. I’d like users to be able to find content from each of the domains, but I want to give preference to the site they’re currently visiting.**

> **More specifically: if I’m searching on my docs site, I’d like the top 5 results to come from the docs site, and then after that I’m ok with a mix of results from all three sites (docs, blog, www).**

Controlling domain based relevancy is a two-step process. The first step is to include domain information in your indexed documents using Swiftype meta tags. For each domain, you’ll want to include a numeric value representing the current domain. Say for example you have three domains, [one.com](http://one.com), [two.com](http://two.com) and [three.com](http://three.com). For pages on [two.com](http://two.com) include the following meta tags:

```auto
<meta class="swiftype" name="onecom" data-type="integer" content="1" />
<meta class="swiftype" name="twocom" data-type="integer" content="2" />
<meta class="swiftype" name="threecom" data-type="integer" content="1" />

```

For each of the other domains, change the content attribute from 1 to 2 to match the domains.

After adding the meta tags, request a recrawl from the Swiftype dashboard.

Once you have the domain fields indexed, you can control relevancy at query time using the [functional boosts](https://swiftype.com/documentation/searching#functional_boosts) feature. When on the [two.com](http://two.com) domain, the query syntax will be something like:

```auto
curl -XGET 'https://api.swiftype.com/api/v1/engines/bookstore/document_types/books/search.json' \
  -H 'Content-Type: application/json' \
  -d '{
        "auth_token": "YOUR_API_KEY",
        "q":"my search",
        "functional_boosts":{
          "page":{
            "twocom":"exponential"
          }
        }
      }'

```

This structure of this query says that the user is on the [two.com](http://two.com) domain, therefore apply a logarithmic boost to the `twocom` field. The `twocom` field will be indexed as 1 for the domain [two.com](http://two.com) and 0 for all others.

When on the [three.com](http://three.com) domain, the query syntax will change to apply a functional boost to the `threecom` field (`"threecom":"logarithmic"`).
