Boolean search logic can be used to define a specific subset of videos that you want returned from your search in Tubular Labs' data. Boolean operators are instructions that the search will understand in order to bring back your videos of interest. These include AND, OR and NOT. These operators, when combined with structural aids such as brackets and quotation marks, will allow for very specific searches of our robust social video dataset. Your Boolean search terms will be matched against data found in video titles, descriptions, and tags.
Basic Boolean Operators
AND - A limiting operator. The more AND operators in use, the fewer results you will find. For example:
- Gaming AND consoles = 1383 matching videos
- Gaming AND consoles AND esports = 6 matching videos
The “AND” operator is used to refine a search. For example, if you are interested in creating a search about both music and gaming, you would type the following into the search bar: music AND gaming. This means every video returned in the results has to be related to both music AND gaming. If a video is about gaming but not about music, that video will not be returned in the search results.
OR - An expanding operator. The more OR operators in use, the more results you will find. For example:
- Gaming OR consoles = 1.8M matching videos
- Gaming OR consoles OR esports = 1.9M matching videos
The “OR” operator is used to expand a search. Sticking with the same example, if you are interested in creating a search about music or gaming (either one), you would type the following into the search bar: music OR gaming. This search is saying, “find me all content about music or gaming.” Using the OR operator is less restrictive and will return more results than using the AND operator.
NOT - An excluding operator. This is used to remove irrelevant returns from your results. For example:
- Gaming OR consoles = 1.8M matching videos
- Gaming OR consoles NOT esports = 1.7M videos
The “NOT” operator removes content from your search results. For example, if we were interested in content about music or gaming, but did not want content related to concerts, we would type the following into the search bar: music OR gaming NOT concerts. This would return all content related to music or gaming, but would not include content that relates to concerts.
Additional Boolean Operators
# - Returns videos containing specific hashtags in the video title, description or tag.
@ - Returns videos containing social handles in the video title, description or tag.
Structural Aids
Quotation Marks - These allow you to search for exact phrases in a video. For example:
- Gaming - is a singular word and does not require quotation marks.
- “Mobile gaming” - is more than one word and so requires quotations to match videos with that exact set of words.
There is no limit to the number of words that can be between quotation marks, but the search will look for that whole set of words so it is advisable to only quote the minimum words necessary for your search.
Brackets - These help separate Boolean Operators so a search is not confused. They act like full stops and paragraphs for your search.
Take the line: (Gaming OR consoles AND esports.) This is confusing as a search because you have an OR and AND operator on the same line so there could be two different ways of interpreting this instruction:
- Videos containing the words ‘gaming or consoles’ but only if ‘esports’ is also in the title, description or tag of the video.
- Correct Boolean for this command:
(games OR consoles) AND esports (23.5k videos)
- Correct Boolean for this command:
- Videos containing the word ‘gaming’ or any videos which contain both the words ‘consoles and esports’ in their title, description or tag of the video.
- Correct Boolean for this command:
games OR (consoles AND esports) (1M videos)
- Correct Boolean for this command:
Constructing Boolean Searches
Using an example, we’ll look at how to layer the operators and structural aids in order to return the most accurate videos of interest.
Example Brief: "The client wants to isolate videos with content related to cat sounds as part of a project into ASMR videos."
1. Starting out
Build a simple search string:
- cats AND (purring OR meowing)
This may seem good, but it’s not inclusive of different ways in which relevant videos may be described online. We may be missing important videos with this search.
2. Improving Search Terms
Consider the different ways in which a person posting video content may be describing it in their title, description or tag of the video:
- cat OR cats OR dog OR dogs AND (purring OR purrs OR purred OR meow OR meows OR meowed OR meowing OR growling OR growl OR growled OR growls)
This results in 400 additional videos now captured by being mindful of how cat noises may be described online in video titles, descriptions or tags.
For exploring multiple synonyms for words consider utilizing open source AI technologies for idea generation.
3. Utilizing Structural Aids
Next check for the inclusion of both additional Boolean operators (#’s and @’s) as well as add in brackets or quotation marks where necessary.
- (cat OR cats OR dog OR dogs OR #cat OR #cats OR #dog OR #dogs) AND (purring OR purrs OR purred OR meow OR meows OR meowed OR meowing OR growling OR growl OR growled OR growls OR #purring OR #purrs OR #purred OR #meow OR #meows OR #meowed OR #meowing OR #growling OR #growl OR #growled OR #growls)
Open source AI technologies can be used to add repetition with the addition of #’s or @’s to your string.
4. Dealing with Irrelevant Video Results
Particularly when dealing with ambiguous brand names or words used in multiple contexts you may find videos coming back which are not what you’re looking for.
Scenario: If a search was done to segment all videos related to push bikes and a Boolean string was produced displaying (bicycle OR bicycles OR bike OR bikes). The problem here is that there will be many irrelevant videos displayed, such as those around motorcycles.
There are two main ways we can deal with removing irrelevant returns from our search:
- Add context with brackets:
- (bicycle OR bicycles OR ((bike OR bikes) AND (push OR pedal OR pedals OR mountain OR road OR electric))
- Note that there are now multiple brackets in use. There may still be some irrelevant videos so can also:
- Exclude using NOT operator:
- (bicycle OR bicycles OR ((bike OR bikes) AND (push OR pedal OR pedals OR mountain OR road OR electric)) NOT (motorbike OR motorbikes OR motorcycle OR motorcycle OR petrol OR engine)
- Note that videos will now be removed if they include keywords associated with motorcycles.