API Reference / API Methods / Search / Get Object Position
Required API Key:
Method signature
SearchIndex::getObjectPosition(object results, string objectId)

About this method # A

Retrieve the given object’s position in the given results set. Can be used to debug relevance.

getObjectPosition may be used to debug the relevance of an objectID in specific results set. If the objectID is found, the position of the object is returned.

Examples # A

1
$position = SearchIndex::getObjectPosition($results, 'a-unique-identifier');

Parameters # A

results #
type: key/value mapping
Required

The results set of a search.

objectId #
type: string
Required

The objectID of the record.

class #
type: class
Required

Only for Java and Scala: the type of the hits.

Response # A

No response

Did you find this page helpful?
PHP v3