Assistance de TMDB

I'm using the API to lookup movies in my app, and am counting on the first result being the correct match (it's a data import operation, in which the user provides the movie title and year). I'm not understanding the ordering for one of my test cases, though. If I search for "Batman: The Dark Knight Returns", year 2013, "Batman: The Dark Knight Returns, Part 2" comes up as the first result. Is it because it has a higher popularity value? It would seem the exact match on title should win. This is the call I'm making:

https://api.themoviedb.org/3/search/movie?api_key=__key__&query=Batman:%20The%20Dark%20Knight%20Returns&year=2013&page=1

This is the JSON returned:

{
    "page": 1,
    "results": [
        {
            "adult": false,
            "backdrop_path": "/wDWPuqhgZ0INvqHsyLa470xeabT.jpg",
            "genre_ids": [
                16,
                28
            ],
            "id": 142061,
            "original_language": "en",
            "original_title": "Batman: The Dark Knight Returns, Part 2",
            "overview": "Batman has stopped the reign of terror that The Mutants had cast upon his city.  Now an old foe wants a reunion and the government wants The Man of Steel to put a stop to Batman.",
            "popularity": 2.82081,
            "poster_path": "/wPeorCnD9MRR2S9Dzh4OpIgNLiv.jpg",
            "release_date": "2013-01-29",
            "title": "Batman: The Dark Knight Returns, Part 2",
            "video": false,
            "vote_average": 7.82,
            "vote_count": 191
        },
        {
            "adult": false,
            "backdrop_path": "/JVmx7spmiNj2tfaogM9hPo0qkC.jpg",
            "genre_ids": [
                16,
                28
            ],
            "id": 312886,
            "original_language": "en",
            "original_title": "Batman: The Dark Knight Returns",
            "overview": "It is ten years after an aging Batman has retired, and Gotham City has sunk deeper into decadence and lawlessness. Now, when his city needs him most, the Dark Knight returns in a blaze of glory. Joined by Carrie Kelly, a teenage female Robin, Batman takes to the streets to end the threat of the mutant gangs that have overrun the city. And after facing off against his two greatest enemies, the Joker and Two-Face, for the final time, Batman finds himself in mortal combat with his former ally, Superman, in a battle that only one of them will survive.",
            "popularity": 1.322084,
            "poster_path": "/6qIkuY9MxEVyYIsaK16WtcMWVxy.jpg",
            "release_date": "2013-09-10",
            "title": "Batman: The Dark Knight Returns",
            "video": true,
            "vote_average": 8.17,
            "vote_count": 24
        }
    ],
    "total_pages": 1,
    "total_results": 2
}

2 réponses (sur la page 1 sur 1)

Jump to last post

Hi Dov,

Ultimately the search score (as calculated by Elasticsearch) is the most important. Popularity influences the score though (but only helps boost the final score, we don't sort by it) as do all of the translated and alternative titles.

In this case, it could be the popularity bumping it just enough to move it to #1.

Alright, thanks. I'll have to match to the exact title match client side.

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion