FindResults.TopScore Property
FindResults.TopScore Property
A number representing the score (FindResult.Score property) of the first found result in the array of results. Double.
Public TopScore As System.Double
[C#]
public System.Double TopScore;
Remarks
The results of a find operation are ordered by score; that is, by how well the result matches the search criteria or how close the result is to the search point. For the FindServiceSoap.Find and FindServiceSoap.FindAddress methods, the higher the score the better the match. For the FindServiceSoap.FindNearby and FindServiceSoap.FindNearRoute methods, the lower the score, the closer (nearer) the match.
This property has no significance for the FindServiceSoap.FindByID, FindServiceSoap.FindByProperty, and FindPolygon methods. The TopScore is always either a 1 or 0 depending on if there is a match or not.
If the StartIndex property is 24, the TopScore property is the score for the 25th result; the first result in the array of results (Results property).
Example
[Visual Basic]
'Output the first find result if it is a good match
Dim findSpec As New FindSpecification()
findSpec.DataSourceName = "MapPoint.NA"
findSpec.InputPlace = "Seattle, WA"
Dim foundResults As FindResults
foundResults = findService.Find(findSpec)
If (foundResults.TopScore > 0.9) Then
Console.WriteLine(foundResults.Results(0).FoundLocation.Entity.DisplayName)
End If
[C#]
//Output the first find result if it is a good match
FindSpecification findSpec = new FindSpecification();
findSpec.DataSourceName = "MapPoint.NA";
findSpec.InputPlace = "Seattle, WA";
FindResults foundResults;
foundResults = findService.Find(findSpec);
if (foundResults.TopScore > 0.9)
{
Console.WriteLine(foundResults.Results[0].FoundLocation.Entity.DisplayName);
}
See Also
FindResults Class | FindResult.Score Property | FindServiceSoap Class