> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get object position

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

Use this method to debug the relevance of an `objectID` in specific results
set. If the `objectID` is found, the position of the record is returned.

## Examples

<CodeGroup>
  ```cs C# theme={"system"}
  var position = searchResponse.GetObjectPosition("a-unique-identifier");
  ```

  ```go Go theme={"system"}
  position := queryRes.GetObjectPosition("a-unique-identifier")
  ```

  ```java Java theme={"system"}
  int position = searchResponse.getObjectPosition("a-unique-identifier", Hit.class);
  ```

  ```js JavaScript theme={"system"}
  const position = index.getObjectPosition(results, 'a-unique-identifier');
  ```

  ```kotlin Kotlin theme={"system"}
  val position: Int = responseSearch.getObjectPosition(ObjectID("a-unique-identifier"))
  ```

  ```php PHP theme={"system"}
  $position = SearchIndex::getObjectPosition($results, 'a-unique-identifier');
  ```

  ```python Python theme={"system"}
  position = SearchIndex.get_object_position(results, 'a-unique-identifier')
  ```

  ```ruby Ruby theme={"system"}
  position = Algolia::Search::Index.get_object_position(objects, 'a-unique-identifier')
  ```

  ```scala Scala theme={"system"}
  val position = res.getObjectPosition[Hit.class]("a-unique-identifier")
  ```

  ```
  let position = searchResponse.getPositionOfObject(withID: "a-unique-identifier")
  ```
</CodeGroup>

## Parameters

<ParamField body="class" type="class" required>
  **Java and Scala only**: the type of the hits.
</ParamField>

<ParamField body="objectId" type="string" required>
  The `objectID` of the record.
</ParamField>

<ParamField body="results" type="object" required>
  The results set of a search.
</ParamField>
