Try our conversational search powered by Generative AI!

500 error when searching


When I use 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?



Apr 02, 2013 10:10

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.

Apr 02, 2013 10:27

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

Apr 02, 2013 10:54

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



Apr 02, 2013 10:56

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?

Apr 02, 2013 11:03

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; }

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)))



Apr 02, 2013 11:08

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?

Apr 02, 2013 11:11

That has stopped the 500 error, excellent!



Apr 02, 2013 11:19


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.

Apr 02, 2013 11:21

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.

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.