27 March, 2016 by Tom
This article is designed to give an overview of the types of advanced Twitter searches you can perform within Twitter’s officialsearchor using Social Bearing’s advanced search form
Tweets containing the word ‘sunrise’ in Indonesian (lang:in) using Social Bearing’s advanced Twitter search
The advanced Twitter search features allow you to search tweets from a specific language, date range, media type and more. Queries can also be built up using boolean operators such as AND and OR
All search features and operators described in this article can be used from Social Bearing’s advanced Twitter search feature, availableat the bottom of the standard tweet search
Twitter search using Social Bearing’s advanced options
A regularTwitter search
Before we get to the good stuff, lets run over howa regularTwitter search works
A standard search will find and return tweets that match thekeyword, hashtag, handle, URL or any other string of text searched for
Tweets are matched based on the content of the tweet; not only the textual content but will include the handle of the usertweeting or retweeting. Destination URL linkswithin tweets are also matched, even if those links have been shortened for display purposes
If more than one word or hashtag has been search for, then tweets are matched againstallsearch words, but in any order within the content of the tweet
Whole words are matched in a searchand plurals are treated as if they were separate words.Searching for ‘cloud’ for example will not match tweets against ‘clouds’
Hashtags are treated slightly differently. A search for ‘cloud’ will find tweets with the hashtag ‘#cloud’ as well as ‘cloud’ but the opposite is not true; searching for ‘#cloud’ will only find tweets for that hashtag
Exact Match Searches
Enclosing keywords “within quotes” will perform an exact match search; treating multiple keywords as if it were a single string
In the Social Bearing search, you can selectthe ‘exact match’option which will enclose the search term with quotes
Exact match search for tweets containing “space walk”
As an example, if you wanted tofind tweets mentioning the phrasespace walk, you would probablywant to usean exact match search“space walk”.Without using quotes, tweets would bereturned for the words ‘space’ and ‘walk’ usedanywhere within atweet; the default search behaviour. A tweet containing the text‘..walk around in this space..’ would probably not be relevant to thissearch
The OR operator
Using theOR operator would findtweets containing one word OR another. For example, the search phrase#sunrise OR sunset would find tweets containingeither the hashtag #sunrise or the word sunset,in any order.
The ‘OR’ operator shouldbe uppercase, otherwise the search will assume you were searching for the word ‘or’.
The AND operator
The‘AND’ operator can be used in the same way asOR, but the use of this operator alone istreated in the same way as a regular search.
For examplesearching for‘sunrise sunset’ or ‘sunrise AND sunset’ is essentially the same; tweets that contain both these words will be matched in any order.
The main reason you would want to use the AND operator is when stringing multiple operators together.
Combining Operators
For more complex Twitter searches, multiple operators can beused together to create a single search string.
Let’s say you wanted to search for design based jobs in London. Tweets advertising jobs might use numerous synonyms for the word ‘job’. To to help maximise tweets found, we could construct a search string using the AND and OR operators with variations on the word ‘job’, such as:
(London) AND (design OR designer OR creative) AND (career OR job ORjobs OR vacancy OR vacancies OR role)
The abovequery will find all tweets that mention ‘London’ along with any one of threevariations on job title and any one of five variations of the word ‘job’.
Using a Social Bearing searchwith the above stringreturns over 500 tweetswithin the past 24 hours. When compared against a search for design jobs Londonwhichgets less than 100 tweets in a similar timeframe, it’s easy to see how useful complex search queries can be.
The use of brackets arealso important as theyallow multiple words and operator rulesto be groupedtogether.
Within any regular search, a maximum limit of 500characters can be allowed in a search string, after the string is URL encoded (for example a space will take up 3 characters when encoded as ‘%20’ in the URL).
Exclude keywords from tweet search
The hyphen “-” is equivalent to the boolean NOT operator. Using a hyphen with a keywordwill exclude tweets containing thatword (or hashtag etc) from the search results.
For example, the search
easter -egg -eggs
Will find tweets containing ‘easter’ but not ‘egg’ or ‘eggs’.
Find tweets from any language
When searching for tweets, you can select from62 popular languages supported by Twitter using either the language drop down in the Social Bearing advanced Twitter search form or by using thelang:operator in the search field followed by the 2 letter language ISO code.
For examplelang:dewould search for German tweets.
The lang:commandcan be used by itself without any keywords, or combined with a regular search term and other operators.
Read more about finding tweets in a certain language
Find tweets from a specifichandle
If you want to find any tweets for a given handle only, including regular tweets, retweets and replies then thefrom:command will be useful for this.
Afrom:search is essentially the same as a user timelinesearchwith the 7 day limit applied, so it is only really useful when used alongsideother search commands to narrow down a twitter search.
For example
from:snowdenapple
Will find all tweets mentioning ‘apple’ from @snowden handle
from:handlecan be used in a search by itself or combined with any other commands or operators.
Find tweets to a specific user
The to:command in a Twitter searchwill find all direct tweets or replies from any handle to a specific handle. It does not include mentions of handle; to find mentions, a regular search of the @handle would do this.
You can use to: by itself or with other combinations. Usingto:withfrom:can be useful to search forcommunications between two users.
You can also usedto:andfrom:for the same Twitter user. This mightbe useful when you want to see replies a user has made to their own tweets.
Searching fortweets between dates
The commands since: and until: can be used to find tweets between two dates. On the Social Bearing advanced search formyou can use the drop down’s, otherwise you’ll need to enter dates in the format since:yyyy-mm-dd or until:yyyy-mm-dd in the searchfield.
As with most Twitter tools, tweets are limited to the past 7 days using Twitter’s free API. Some tools such may go back further but these are usually paid services that make use of enterprise level historical platformssuch as GNIP
Date based searches will take into account the retweet date to determine if retweets should be displayed, rather than the date the original retweeted tweet was created
The until date will not include the chosen dateand will work up until that date. So if you select an until date of 2016-03-02, that should include all tweets up until midnight 2016-03-01
Selecting asince:and until: date with the same values therefore will return empty result. since: includes the selected date and beyondwhereas until: includes everything before
Find tweets withpictures, videos or links
The filter: command using ‘media’, ‘videos’ or ‘links’ can be used in a search to findtweets containing media of these types. Alternatively, you can use the media options in the advanced search form
Tweets containing photos
The phrase sunset filter:media will find all tweets with images or videos. There is no ‘photo’ only based tweet command that can be used in a search, however you can still filter media types and select only pictures from the Social Bearing searchfilters on the results page
Find tweets containing videos
The filter:videos command is used to find tweets containing videos only. This will search for any tweets that havehadvideos uploaded directly to Twitter, or tweets containing links to popular video sites such as YouTube, Vine or Vimeo
Search fortweets withlinks
Tweets with any kind of link can be searched for using filter:links. Link filters also include pictures and other media as these are attached as a link to a tweet e.g. pic.twitter.com/vbas43asd
To further refine tweets with website links only, in the resulting Social Bearing search, you can select the ‘Links’ tweet type filter which don’t count picture based links
Find positive or negative tweets
You can use basic emoticons🙂 or 🙁 within a regular search to find tweets with a generally positive ornegative sentiment
For example, the searchspring🙂will likely contain positive tweets about Springandspring🙁will more likely benegative. This kind of search however doesn’t analyse the language used to determine sentiment; it will only match tweets containing positive or negative emoticons
Variations of these emoticons though are also taken into account. For example, a positive search using 🙂 will also return tweets containing 🙂 and 😀 which are all positivevariations of the smiley
The smileys can be used independently in a search or combined with keywords and other operators
A basic sentiment search using Twitter operators is different from how Social Bearing calculates sentiment, which assigns sentiment based on the words used within tweets
FurtherInformation
Examples of additional operators and examples that can be used in a Twitter Search can be found on Twitter’ssearch API page
Leave a Reply
Next Post:
Last post: New feature: Tweet layout mode »