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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:14:58+00:00 2026-05-26T03:14:58+00:00

Until we completely figure out our full text search strategy, we have come up

  • 0

Until we completely figure out our full text search strategy, we have come up with a reasonable solution to show our Business owners how the functionality will work. With that said, we are using Entity Framework 4.1 and the code first approach. We have created a stored procedure to pull back results in a standard format. Here is an example of the search result class:

public class SearchResult
{
     public Guid EntityId {get;set;}
     public string DisplayText {get;set;}
     public string Icon {get;set;}

}

Now, no data actaully will go into a table for SearchResults. The idea is we would search multiple entities and build the results using that structure.
The SP looks similar to this:

CREATE PROCEDURE dbo.Search(
@term varchar(200),
@topSelect int = 5,
@isPrefix BIT = 0,

)
AS
BEGIN
  Declare @SearchTerm varchar(250)
    If (isNull(@isPrefix,0) = 0)
        begin  
            Set @SearchTerm = '%' + @term + '%'
        end
    Else
        begin
            Set @SearchTerm = @term + '%'
        end

select top (@topSelect) 'Project' as 'Controller',
       [Id],
       Name as 'DisplayText',
       'PROJECTICON'       as Icon
from Projects
where Name like @SearchTerm
UNION
select top (@topSelect) 'Rfi' as 'Controller',
       [Id],
       [Number] + ' - ' + [Number] as 'DisplayText',
       'RFIICON'       as Icon
from Rfis
where (Subject like @SearchTerm or
      Description like @SearchTerm or
      Number like @SearchTerm)
End

Can I call the stored procedure with EF and fill the SearchResult “entity” with the results from the SP or do I need to do it without EF?

The idea is the same as using an index, but we are searching the live data. Again, this is a temporary solution for our needs until we have fleshed out what FTS solution we want to use.

Update:

After some research I think this may be the behavior…I will report back.

  • 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-26T03:14:58+00:00Added an answer on May 26, 2026 at 3:14 am

    As long as you have the same column names as in the entity everything maps just super-duper! Check this out for more info on using an SP with EF. One thing to keep in mind is if you come across this error: “The SqlParameter is already contained by another SqlParameterCollection”, make sure to use something like ToList() on the collection or the query will try to run again if you try to use it. At least, that is what I found in my application.

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

Sidebar

Related Questions

I have never used DBIx::Class until today, so I'm completely new at it. I'm
I'm trying to figure out how to have Spring Security return a UserDetails object
So, we were coding an Android application in Eclipse, and we couldn't figure out
Perhaps I'm just having trouble figuring out the callbackyness, but I can't figure out
I'm trying to figure out how non-destructive manipulation of large collections is implemented in
Hello I've been trying to figure out generic way to log http requests in
I want a splash screen to show while the application is loading. I have
I'm trying to figure out how I can use Console.ReadLine and a timer. My
We have been working on a project for several months without any problems until
I've been handed an application to support, and I'm trying to figure out how

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.