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 6193127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:03:52+00:00 2026-05-24T03:03:52+00:00

Hi, I need to let the enduser type search strings like : Volvo S70

  • 0

Hi,

I need to let the enduser type search strings like :

Volvo S70 OR S60 > All posts that contins Volvo OR S70 OR S60

Volvo S70 NOT S60 > All posts that contains Volvo and S70 but not S60

“Volvo S70” > All posts that includes “Volvo S70” as one string

Volvo S* > All posts that contains Volvo and a word starting with S

“Volvo S70” “Volvo S60” V* > All posts that contains “Volvo S70” or “Volvo S60” Or a word starting on V

Vo*l* S* > * is treated as wildcards so in this case posts that contains Vo*l* or S*

This is just a small part off possible combinations.

How do I handle this with Linq to Object?

I Know that I can use StartsWith, EndsWith, Contains but this will mean that I have to split the incoming search string, is this the only way? And how do I then handle strings like Vo*l*?

BestRegards

Edit1: The data have been fetched from database with entityframework, this means that the data is now in application (List)

  • 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-05-24T03:03:53+00:00Added an answer on May 24, 2026 at 3:03 am

    My solution is to use ESQL like this :

    using (Entities context = new Entities())
          {
    IQueryable<Ad> ads = context.CreateQuery<Ad>("SELECT VALUE C FROM Ads AS C WHERE C.Title LIKE @searchS OR C.Description LIKE @searchS", new ObjectParameter("searchS", searchS));
    
                ads = ads.Where(c => c.InactivatedDate.HasValue == inactive);
                ads = ads.Where(c => c.PublishedDate.HasValue && c.PublishedDate.Value.CompareTo(fetchAdsTo.Value) >= 1);
    
                output = ads.ToList();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say i need to find all .bar elements inside an element that's assigned
Let's say I need to develop a plugin for a given technology not supported
Let me try to explain what I need. I have a server that is
I need a basic pdf generator that'll let me toss some images and text
Let's say that for some reason you need to write a macro: MACRO(X,Y) .
Well, the question is not intended to be that big. Let me explain the
I need to let my users type anything at the end of my url,
I need to let all projects in solution contain some additional build actions, e.g.
Basically in order to have a profile Block u need - let's say profile
I need to let users of an application open a folder by clicking a

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.