Writing a search query to collect social content

The Search Query field is where you can specify the elements or keywords to look for on each Filter. 

Query settings are paramount to collect the posts you are looking for.

What terms can we use?

  1. Words (Example: Orange)
  2. Hashtags (Example: #Orange)
  3. Accounts (Example: @Orange)


Which are the search operators we work with?

  1. OR: Allows different terms enumeration to collect in a non-exclusive way.
  2. AND: Allows term combinations.
  3. AND NOT: Allows filtering unwanted terms in a specific search. 
  4. Phrases: Allows searching for literal phrases by surrounding them with quotation marks.
  5. Parenthesis: Allows grouping of different terms. 


What should I do if I need to search for keywords that are also operators?

Imagine you need to search the keyword "and" in a phrase like "Peace and Love". Even if you use quotation marks, you will not be able to search for this phrase unless you escape the operator. You can do so by adding a slash before the keyword:

  • \and
  • \or
  • \and \not
  • \not

Thus, in order to search for "Peace and Love", you will need to add the following phrase on the query input: "Peace \and Love".


Different ways to write a Query:

Remember that these queries depend on what the user wants to collect.

            1) Collect all posts that contain the word: "Orange"

This query is going to collect posts like: "I love Orange", "I want to eat one orange".
But it will not collect posts like: "I want one #Orange", "There are too many Oranges", "Let's follow @Orange".

In the case of words with accent marks, we recommend writing both forms of the keyword in the Search Query field (one with an accent mark and the other one without).


            2) Collect all posts containing the word "Orange", the hashtag "#Orange", or the account "@Orange":

Example of collected posts:
"I want an Orange", "how big is this #Orange", "great @Orange photo".

Example of non collected posts:
"I want an apple or lemon".


            3) Collect all posts containing the word "Orange" and also the word "juice".

Important: When using this query, these terms do not necessarily imply any specific order, so they can appear in any place within the text. 

Example of collected posts:
"I want an orange juice", "I will love to drink one juice, I prefer Orange".

Example of non-collected posts:
"I want one Orange", "I hate drinking juice"


4) Collect all posts that contain the word "orange" but DO NOT contain the word "lemon".

Example of collected posts:
"what a great Orange".

Example of non-collected posts:
"I do not know if I want an Orange or a Lemon", "Orange is better, I hate lemon".


            5) Collect all posts containing "Orange Juice", exactly like that.

Example of collected posts:
"I want to drink one Orange Juice".

Example of non-collected posts:
"I want a juice, but I prefer the Orange one".


            6) Collect all posts containing the word "Orange" and also one of the products: 

The platform uses the parenthesis to group different terms so it is not necessary to repeat it in the query: (Orange AND Juice) OR (Orange AND Candy).

Example of collected posts:
"I want one Orange, or at least one juice", "The new orange candy rules!"

Example of non-collected posts:
"I love drinking juice".


More Examples:
a) Query: #Newshoes
Example of collected posts:
"I want the #Newshoes".

Example of non-collected posts:
"I want the new shoes".


b) Query: ("Brad Pitt" OR #BradPitt OR @BradPitt) AND (Angelina OR @Angelina OR #Jolie)
Example of collected posts:
"Brad Pitt and Angelina are the cutest couple", "Great wedding @BradPitt @Angelina".

Example of non-collected posts:
"Want to meet Brad Pitt with his wife Jolie".

c) Query: (Messi OR #Messi OR @Messi) AND NOT (Barcelona OR Barca).
Example of collected posts:
"Messi is the best player in the World".

Example of non-collected posts:
"I love watching Messi playing at Barcelona", "Messi is the Barca top scorer".

Was this article helpful?