[New Report] Food and Beverage Trends Report

Discover the hottest Food and Drinks Trends of 2023 in our exclusive report 🍕

Find out more

Published May 9th 2014

Tips and Tricks from our Advanced Queries Webinar

Last week we held a webinar and a Twitter Q&A all about writing advanced Queries. For those who missed the webinar, you can see a recording here or the slides here.

In the webinar, we discussed:

  • Testing your Query
  • Removing spam
  • Writing research Queries
  • Using the new operators
  • Q&A

As always, our lovely attendees asked a shedload of questions so here are some of the more common ones and their answers, as well as highlights of some of the top tips from our hosts.

Testing your Query

Here are some essential steps to writing and testing your Query:

  • When testing your Query, take a look at the first and last page of the test results – the results are sorted by most relevant first, so the last page is often a good test to see if things are still relevant.
  • Try context terms first, then exclusions, then a combination of both.
  • Test regularly when adding or removing terms.
  • Review your results in a dashboard, not just in the test search – the Authors and Topics components are particularly useful for highlighting irrelevant mentions.
  • If your volume is still too high even after following relevancy tips, think about refining your objective further.

Removing spam

spamSpam often particularly targets keywords to do with aspirational and consumer brands. Whilst our system is great at finding and removing it, there are always some that slip through as spammers are, unfortunately, persistent and wily!

Try excluding the following words and phrases from your Query using NOT:

  • Inappropriate language (“viagra”, “air jordan”, “porn”)
  • Calls to action (“see deals”, “click now”)
  • Aggressive language (“FOR SALE”)
  • Excessively repeated words (“deals deals deals”)
  • Authors with odd names (“user”, “admin”, “__iphone”)
  • Reseller language (“bids”, “$”)

Writing research Queries

Research Queries allow you to capture mentions of a specific topic rather than a particular brand. For example, people discussing holiday destinations or a particular medical condition or – as we did recently in our report – people discussing their experiences with travel and hospitality.

Here are 8 easy steps to get started:

  1. Define the search objective
  2. Research the topic
  3. Construct and test in Brandwatch
  4. Review a good proportion of the results
  5. Check mentions in a dashboard
  6. Manual exclusions for clean samples
  7. Use personal pronouns
  8. Use ‘thinking’ terms for opinions (thought, consider, think etc.)

Using the new hashtags: and at_mentions:


Our powerful new operators for hashtags and @mentions mean you don’t need to use raw: in order to find mentions of specific @handles on Twitter and hashtags on Twitter and Instagram, making it quick and easy to track the mentions you need.

We wrote a whole post about using them here and there is a user guide for clients here.

Listen to the webinar for more in-depth explanations and demoed examples of the above. Now, let’s take a look at some of those common questions:


Can you narrow the Query’s result down to the site?
Yes and no. We have a site: operator that allows you to specify specific sites you want to capture mentions from. For example,

cats AND site:twitter

Would only collect mentions of cats from Twitter. We also have the more specific url: which can target a specific area of a site, for example

cats AND url:msn.com/news

would only collect mentions of cats on the news section of the MSN site (we’re sure there are a lot of those!).

However, you can’t choose a specific type of site (e.g. forums or news) at the Query creation stage, but you can do this using one of the many Dashboard filters available once you’ve saved your Query.

How do I use location codes?

We have various different operators for specifiying locations for your data, including country:, county: and city:.

Each of these operators uses a code to specify the location – you can find the code for your preferred location by clicking on the Locations button in the Query creation window.

Data_-_Queries_-_Project__Jasmine_tests_-_Brandwatch 6

This’ll then give you a code to use for the operator – for example, for New York we’d do this:

Data_-_Queries_-_Project__Jasmine_tests_-_Brandwatch 4 Data_-_Queries_-_Project__Jasmine_tests_-_Brandwatch 3 Data_-_Queries_-_Project__Jasmine_tests_-_Brandwatch 2


Et voilà!

How do you decide on what % relevancy is ‘good enough’?
We often talk about relevancy with Queries – that is, what percentage of the results are relevant to what you were looking for in the first place.

Firstly, let me say this: there is no such thing as a perfect Query. No such thing. It is impossible to capture every single relevant mention without capturing a few irrelevant ones and vice versa.

So, the % of relevancy depends on your objectives. For a brand Query that is going to be used for reporting and the like, you should probably be aiming for at least 90% accuracy, though it does depend on the brand.

For a research Query, it’s likely you’re going to have to be a bit broader and aim for something around 70% relevancy. Casting a wider net will get you a broader scope of mentions around the topic you are interested in and you can always make manual exclusions in the dashboard to ensure a cleaner data set for reporting.

To evaluate the relevancy, try reading through some of the test mentions and count roughly how many are relevant (e.g. read 30 mentions in the test search and if, say, 3 are irrelevant, you have 90% relevancy).


Why use NEAR/n instead of AND?
Whilst you might start with AND when writing a Query, we nearly always recommend using NEAR/n when using context terms (e.g. (cats NEAR/5 (dogs OR frogs)).

This is because using this operator gives much better accuracy, by specifying that the terms must be within so many words of each other rather than just on the same page.

How do I choose what number to use with NEAR/n?
We find NEAR/15 or NEAR/20 is generally best, as this is about the average length of a sentence so means the two terms are in the same sentence. However, for some things you might want this much wider – say NEAR/100 – and for others, much smaller like NEAR/2 or even NEAR/0 (so the terms are directly next to each other).

It depends on your objectives and what you’re searching for – as always, test different numbers and see what gives the best results.

What’s the difference between NEAR/n and NEAR/nf?
NEAR/n specifies that the terms must be within the specified number of words of each other. NEAR/nf does the same, but with the added constriction of direction.

F stands for forward, so ‘dogs NEAR/5f cats’ matches mentions where dogs is within 5 words of cats, but only when dogs comes first – e.g. it’d match “dogs really love cats” but not “cats really love dogs”. And no, there isn’t a backwards version – just swap your terms around!


How do I use the proximity ~n operator?
The proximity operator (~n) works a bit like the NEAR/n operator, but allows you to put multiple terms (in quotation marks) and each of the words has to be ‘n’ number of words from one of the other words.

For example, in the webinar Nate used the example of “deal deals deals”~100 to remove spammy mention where deals is written repeatedly within 100 words.

How are special characters treated, are they counted as spaces?

Unless you are using raw: the system ignores all special characters and capitalisation, treating special characters as white space. So, for example, searching for ‘I’ve’ would return “I’ve”, “i’ve”, “i ve” or “I ve”, but not ive. However, if you use raw:I’ve it will only match ‘I’ve’ with a capital I and an apostrophe, and not ‘i’ve’ or ‘I ve’ and so on.

Can you use raw: with NEAR/n?
You can use raw: with NEAR/n but only if it’s on both sides of the operator. For example, you could write ‘raw:Dog NEAR/5 raw:Cat’ but not ‘raw:Dog NEAR/5 cat’.

Just remember it as like a seesaw: it needs to be balanced (the reason for this is complicated, but is to do with the language we use for our operators system. Unfortunately, it cannot be changed!)

Can I use brackets or wildcards with the new operators?
Yes, you can use the * or brackets with the new hashtags: and at_mentions: operators. You can thank us later!

Got some more questions? Just give us a tweet or leave a comment and we’ll be happy to help. Plus, get lots of handy tips from our wide range of other Query resources.

Share this post
Guide Monitoring
Brandwatch Bulletin

Offering up analysis and data on everything from the events of the day to the latest consumer trends. Subscribe to keep your finger on the world’s pulse.

Get the data
facets Created with Sketch.
facets-bottom Created with Sketch.
New: Consumer Research

Harness the power of digital consumer intelligence

Consumer Research gives you access to deep consumer insights from 100 million online sources and over 1.4 trillion posts.

Brandwatch image
Brandwatch image
Brandwatch image
Brandwatch image

Falcon.io is now part of Brandwatch.
You're in the right place!

Existing customer?Log in to access your existing Falcon products and data via the login menu on the top right of the page.New customer?You'll find the former Falcon products under 'Social Media Management' if you go to 'Our Suite' in the navigation.

Paladin is now Influence.
You're in the right place!

Brandwatch acquired Paladin in March 2022. It's now called Influence, which is part of Brandwatch's Social Media Management solution.Want to access your Paladin account?Use the login menu at the top right corner.