500 error when searching

Vote:
 

When I use client.search to perform a search, I get a 500 error returned from the Find API, however when using a unified search, the search works.

Has anyone experienced this before? Does anyone know why this would happen?

 

Thanks.

#69655
Apr 02, 2013 10:10
Vote:
 

I've discovered this only seems to happen when doing a geolocation search.  It also gives a 500 error when doing a geolocation search via the Unified search.

#69658
Apr 02, 2013 10:27
Vote:
 

Could you post more details about the exception? Especially interested in the response message from the server.

#69659
Apr 02, 2013 10:54
Vote:
 

I have pasted the stack trace at pastebin, as it's quite long!

http://pastebin.com/BWVMgyAD

 

Thanks

#69660
Apr 02, 2013 10:56
Vote:
 

Hmm, odd. For debug purposes, could you try adding the below to your query?

.Filter(x => x.MatchType(typeof(TPage))

Where TPage is a type that has a SearchGeoLocation property?

#69661
Apr 02, 2013 11:03
Vote:
 

I get the same error.

My pageType has the following for the geolocation

 

[Display(GroupName = Global.GroupNames.Stores, Name = "Latitude", Prompt = "Latitude")]
public virtual string Latitude { get; set; }

[Display(GroupName = Global.GroupNames.Stores, Name = "Longitude", Prompt = "Longitude")]
public virtual string Longitude { get; set; }

[Ignore]
public virtual GeoLocation Location { get { return new GeoLocation(double.Parse(Latitude), double.Parse(Longitude));} }

 

My query for the search is:

 

query = query.Filter(x => x.SearchGeoLocation.WithinDistanceFrom(office, 5.Miles()))
.Filter(y => y.MatchType(typeof (StorePage)))
.Take(10);

 

Thanks

#69662
Apr 02, 2013 11:08
Vote:
 

Hmm, looks like the property is named Location on StorePage's but you're filtering on SearchGeoLocation. Could you try changing its name to SearchGeoLocation and reindex (publish it or run the scheduled job) at least one page with a location?

#69663
Apr 02, 2013 11:11
Vote:
 

That has stopped the 500 error, excellent!

 

Thanks

#69664
Apr 02, 2013 11:19
Vote:
 

Great!

It's still a bit odd that you got a 500 though. If you asked the server to sort by the field it would have made sense but not when you only filtered on it. Anyway, glad it fixed it.

#69665
Apr 02, 2013 11:21
Vote:
 

Some validation is done in the query parsing step in Elasticsearch for different types (among them geo_point) so if it hasn't been registered (i.e nothing has been indexed for the specific field) it will throw an error.

#69739
Apr 04, 2013 9:22
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.