Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

6
[PRAW] How to search by multiple criteria
Post Flair (click to view more posts with a particular flair)
Author Summary
TheDevilsMailbox is in PRAW
Post Body

I know you can do something like:

for submission in subreddit.search('bunnies', sort='relevance', syntax='lucene', time_filter='all', limit=10):
    print(submission.title)

However I'm wondering if it's possible to search by two or more criteria.

For instance, if these posts exist:

George the bunny

Betty the bunny

George the spider

I want to be able to search by criteria 'bunny' and 'george' to find only the first post.

Edit:

Thank you to kungming2 for the response but I figured out the solution and it was even more simple (and I feel a little silly as a result):

for submission in subreddit.search('george bunny', sort='relevance', syntax='lucene', time_filter='all', limit=10):
    print(submission.title)

As you see, I simply separated multiple searches with a " " sign.

Author
Account Strength
60%
Account Age
6 years
Verified Email
No
Verified Flair
No
Total Karma
148
Link Karma
25
Comment Karma
123
Profile updated: 5 days ago
Posts updated: 1 month ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago