Forum Discussion

jasim's avatar
jasim
Helper
12 years ago
Solved

Can we get all posts containing multiple tags using Search API

Hello, 

We are trying to use the /search/messages API to get the posts based on tags. 
We want to get all posts which contain tags "<tag1>" or "<tag2>". 
Is there any way we can pass more than one key word to search API. 

Your help would be highly appreciated. 

Thanks, 
Jasim

  • Hi Jasim,

     

    what you can do is something on the lines of the below, by passing an OR expression to the query parameter

     

    /search/messages?q=labels:(Tag1%20OR%20Tag2)

     

     

    Does that solve your problem?

     

    Cheers,

2 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    Hi Jasim,

     

    what you can do is something on the lines of the below, by passing an OR expression to the query parameter

     

    /search/messages?q=labels:(Tag1%20OR%20Tag2)

     

     

    Does that solve your problem?

     

    Cheers,

  • jasim's avatar
    jasim
    Helper
    12 years ago
    Thanks Paolo. It solves the problem.

    Thanks,
    Jasim