Try our conversational search powered by Generative AI!

Performing a single search on Multiple Keywords and on Multiple Properties

Vote:
 

Hello everyone,

I need to create a search page for a client and the main requirements are:

  • The page must take multiple search keywords and return the results that contain all the keywords. For example, if keyword 1 for the name is "cars" and keyword 2 for material is "steel" the items returned should have both of them.
  • The results must contain the search keywords in their fields. For example, if the item property is "steel" and the query word is "tee", it should retrieve that item (probably a wildcard search here)
  • The search must support pagination

Ideally what I would do should be this, but I already know that these options are not possible:

var query = search
    .For("cars").InField(x => x.Vehicle)
    .For("steel").InField(x => x.Material)
var searchQuery = search.
  .Filter(x => x.Vehicle.Contains("cars"))
  .Filter(x => x.Material.Contains("steel"))

I have been trying to do multiple searches. One search query for each one of the different keywords, and then join the results at the end, but because of pagination this is not a great idea.

Could you please help me?

Im using Find .NET API Version: 13.4.5.0

#314754
Dec 27, 2023 5:33
Vote:
 

I have forwarded this question to one of our member in Find team, hopefully he will give some thoughts soon 

#314975
Jan 02, 2024 13:17
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.