Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:43:29+00:00 2026-06-17T18:43:29+00:00

Given the search term big file larger desk, how would I search for 1)

  • 0

Given the search term “big file larger desk”, how would I search for 1) any of the results; and 2) all of the results.

The search I am currently doing is:

results = Path.objects.filter(path__icontains=search)

What I need to do is something along the lines of:

results = Path.objects.filter(path__icontains=search.split())

How would I do both of these? (OR or AND)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:43:31+00:00Added an answer on June 17, 2026 at 6:43 pm

    The first thing you need to know is that you are not actually hitting the database when you filter, so you can do the filtering multiple times without losing to much performance, a first approach can be:

    results = Path.objects.all()
    for s in search.split():
        results = results.filter(path__icontains = s)
    

    that is for AND ans you can use a similar approach for or.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to search a given file name (let say Keyword) in a directory
I have a script which allows to display search results. Given a query there
I am tasked with writing a program that, given a search term and the
Search for a term on amazon.com, for example stack overflow, and the search results
I would like to parse a response from the NYT Search API given in
this is the error given in the console. I'm taking a search term and
For a given word, I want to search for all the substrings that appear
Given a binary search tree (BST). Find the maximum depth of the binary search
Given some typical search form, I can't construct this form action when submitting a
I need ActionScriot code that will parse a given folder and search it for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.