Try our conversational search powered by Generative AI!

Problem in Free Text Search Implementation

Vote:
 

Hi,

I have a free text search method as following:

 private void Search(){var result = client.Search<Content>().For(Query).InAllField().Select(x =>newSearchHit { Title = x.GetType().GetField("PageTitle").ToString(),Text = x.GetType().GetField("PageTitle").ToString(),Url = x.GetType().GetField("LinkURL").ToString()}).GetResult();}

where SearchHit is a custom model class with the properties - Title, Text and Url.

However, on execution of this code I get an error : “no connection could be made because the target machine actively refused it 217.114.87.70:80”.

Can any one let me know what might be the reason for this and how to fix it. Thanks.

Regards,

Rajesh B

#62595
Oct 30, 2012 14:46
Vote:
 

Seems that you are having problems with your EPiServer Find solution. Have you configured it correctly in your config? Is there a firewall that is blocking your request somewhere on the way?

Have the indexing gone correctly? Did you run the scheduled job? I would need some more information

Also it would make more since in my opinon to write the code like below, where you use the Content type and it's typed data:

var result = client.Search<Content>()
.For(Query).InAllField().Select(x => new SearchHit { Title = x.PageTitle ,Text = x.PageTitle ,Url = x.LinkURL }).GetResult();

 

 

#62619
Edited, Oct 31, 2012 8:18
Vote:
 

Hi,

From the ip it seems like your dns has correctly resolved es-api01.episerver.com. If you open your browser and go to http://es-api01.episerver.com/ from your development machine do you get a response telling:

{"status":200,"message":"Welcome to the EPiServer Find Proxy!"}

/Henrik

#62620
Oct 31, 2012 8:30
Vote:
 

Henrik,

I get a Find-Save-Cancel window on accessing the URL from my development machine. On saving and opening it using a notepad, I can see the message:

{"status":200,"message":"Welcome to the EPiServer Find Proxy!"}

Kindly let me know what needs to be done to have it working.

Marcus,

I believe the code that you have suggested will work only when Page Types are build using Page Type Builder, as I don't get the properties - PageTitle, LinkURL on "x." intellisense and I have created the Page Type through admin mode.

/Rajesh B

#62628
Oct 31, 2012 10:22
Vote:
 

In you config you are not using http://217.114.87.70:80/yourkey? You have to use the dns name http://es-api01.episerver.com/yourkey

/Henrik

#62632
Oct 31, 2012 10:54
Vote:
 

Henrik,

I already have the entry as you mentioned and whose format is as below:

<episerver.find serviceUrl="http://es-api01.episerver.com/<mykey>/" defaultIndex="<myindexname>"/>

However, I get the mentioned error: “no connection could be made because the target machine actively refused it 217.114.87.70:80”.

/Rajesh B

#62702
Nov 01, 2012 10:08
Vote:
 

Henrik,

Also I get 'HTTP 403 Forbidden' error on accessing the URL - http://es-api01.episerver.com/<mykey>/

/Rajesh B

#62706
Nov 01, 2012 10:47
Vote:
 

You should get a 403 when accessing http://es-api01.episerver.com/<mykey>/ (it is simply not a valid request, just the root url for the service)

As for your error please verify that your local firewall is not blocking requests (espicially from the w3wp.exe service (IIS)) or that you are using a proxy for the IIS that might block requests. One simple way to test this is to run the following console application and see if you get the same error:

using EPiServer.Find;

namespace ConsoleApplication
{
class Document
{
public string Title { get; set; }
}

class Program
{
static void Main(string[] args)
{
var client = new Client("http://es-api01.episerver.com/mykey/", "myindex");
var result = client.Search<Document>().GetResult();
}
}
}

/Henrik

 

#62707
Nov 01, 2012 10:54
Vote:
 

Henrik,

I did run code in a console application which ran without any error. However the same code doesn't run in my web application. I believe the local firewall is blocking this, as you said. How do I bypass the firewall for this request and make this work? Thanks.

/Rajesh B

#62708
Nov 01, 2012 12:02
Vote:
 

Depending on your firewall vendor that might differ considerably. Your best call is to locate your firewall and vendor and try to google it. There is no way to bypass your firewall by code in your application.


The only access Find needs is TCP to es-api01.episerver.com:80.

/Henrik

#62711
Nov 01, 2012 13:11
Vote:
 

Henrik,

How do I associate the proxy to the client object so that the http requests are routed through the proxy. Thanks.

/Rajesh B

#62753
Nov 02, 2012 9:56
Vote:
 

The client uses the standard HttpWebRequest.DefaultWebProxy, that complies to your defaultProxy settings in the web.config http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx.

/Henrik 

#62757
Nov 02, 2012 10:51
Vote:
 

Hi Henrik,

Setting up of the proxy in web.config solved the connection issues. Thanks.

/Rajesh B

#62827
Nov 05, 2012 10:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.