class_docstr: Ranks Documents based on the value of their specific meta field.
  The ranking can be performed in descending order or ascending order.
  
  Usage example:
  ```
  from haystack import Document
  from haystack.components.rankers import MetaFieldRanker
  
  ranker = MetaFieldRanker(meta_field="rating")
  docs = [
      Document(text="Paris", meta={"rating": 1.3}),
      Document(text="Berlin", meta={"rating": 0.7}),
      Document(text="Barcelona", meta={"rating": 2.1}),
  ]
  
  output = ranker.run(documents=docs)
  docs = output["documents"]
  assert docs[0].text == "Barcelona"
docstr: Calculate the meta field score as a linear score between the greatest and the lowest score in the list.
  This linear scaling is useful for:
    - Reducing the effect of outliers
    - Creating scores that are meaningfully distributed in the range [0,1],
       similar to scores coming from a Retriever or Ranker.
code: def _calc_linear_score(rank: int, amount: int) -> float:
      """
      Calculate the meta field score as a linear score between the greatest and the lowest score in the list.
      This linear scaling is useful for:
        - Reducing the effect of outliers
        - Creating scores that are meaningfully distributed in the range [0,1],
           similar to scores coming from a Retriever or Ranker.
      """
      return (amount - rank) / amount
  
file_path: haystack/haystack/components/rankers/meta_field.py
imports: import logging
  from collections import defaultdict
  from typing import List, Dict, Any, Optional, Literal
  from haystack import Document, component, default_to_dict
label_desc: Use image node_id 7 for calling the MetaFieldRanker obj's underlying member method code with example usage: obj._calc_linear_score(rank, amount) and returns: unknown