Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Using Find in a non episerver application

Vote:
 

Hi All,

I'm building a bot based on the ms bot framework and i'd like to be able to connect to our Find index.

I added the Episerver Find Nuget package to the project and configured the app settings to connect to the index

The issue I have is that all of the search objects require a type when searching .. for example:

var searchResult = client.Search()
                        .For("Beethoven")
                        .GetResult();

This example requires the type of "BlogPost"

Is what I am trying to do possible or does it need to be linked with the CMS?

Any help, much appreciated.

Thanks,

Paul

#190000
Mar 29, 2018 4:57
Vote:
 

You can use Find without Episerver absolutly!

If you do not want to use the typed search then you should use Unified Search, read more here:

https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/searching/Unified-search/

A good way to learn is to look at Allans exampels here, where you can see how he use it in a non epi solution

https://github.com/AThraen/HotelsSample/

Good luck!

#190002
Mar 29, 2018 8:05
Vote:
 

You can use Find without Episerver absolutly!

If you do not want to use the typed search then you should use Unified Search, read more here:

https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/searching/Unified-search/

A good way to learn is to look at Allans exampels here, where you can see how he use it in a non epi solution

https://github.com/AThraen/HotelsSample/

Good luck!

#190003
Mar 29, 2018 8:05
Vote:
 

Thanks Henrik, much appreciated!

#190168
Apr 04, 2018 1:07
Vote:
 

Just to help others out, I managed to get this working and the bot app can talk to the index but there were a few quirks.

As the indexing is done by the main episerver site with find I needed to create a class in the external application with the same name space as the content type in the main site.

for example in the external application:

// use the namespace of the main episerver site 

namespace MyEpiProject.Base.PageTypes
{
public class ContentPage
{
public string PageName { get; set; }
public string PageSummary { get; set; }

}

}

Then use it in the external application as:

var client = new Client("<your epi find URL>", "<Your epi find index name");


var result = client.Search<ContentPage>().For("Your keyword").Select(x => new ContentPage(){PageName = x.PageName, PageSummary = x.PageSummary}).GetResult();

Without this I would get 0 results regardless. 

Hope it helps someone!

#190220
Apr 05, 2018 7:52
Vote:
 

That is true, since when you search for a specfic type then it will use the whole namespace to identify it.

One thing, create the client with .CreateFromConfig() instead.

#190221
Apr 05, 2018 8:07
* 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.