Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with J_H's answer chosen by CommunityBot
Notice added Draw attention by AncientSwordRage
Bounty Started worth 200 reputation by AncientSwordRage
grammar changes and correct spelling
Source Link
Martin Maat
  • 18.6k
  • 3
  • 33
  • 59

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been in, played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This means that, for instance, step 3 for the ~23 actors returned in step 2 for the lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem is that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This means that, for instance, step 3 for the ~23 actors returned in step 2 for the lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem is that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been in, played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This means that, for instance, step 3 for the ~23 actors returned in step 2 for the lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem is that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been in played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This meanmeans that, for instance, step 3 for the ~23 actors returned in step 2 for the lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem beingis that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been in played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This mean that, for instance step 3 for the ~23 actors returned in step 2 for lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem being that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This means that, for instance, step 3 for the ~23 actors returned in step 2 for the lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem is that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?

Tweeted twitter.com/StackProgrammer/status/694356789933051904
Source Link

How to efficiently query movies with characters via The Movie DB API?

I have a sort of whiteboard style question about efficiently querying The Movie DB API to find a list of characters in movies.

My overall aim is to:

  1. Search for a movie by title (1 request)
  2. Look up all the characters played in that movie (1 request)
  3. Look up which movies that character has been in played by the same actor (1 request/movie)
  4. Repeat with that list of movies via step 2, and filter down to only characters in the original movie, until no unexplored characters remain.

My issue is that the DB call for step 3 only brings back the films those actors are in, as opposed to characters (in fact you can only search by actor id, not character id). This mean that, for instance step 3 for the ~23 actors returned in step 2 for lord of the rings, it then returns 844 movies each one needing a request to find the characters in that movie. The problem being that most of these are going to be false positives.

Is there a more efficient way to query the API? I've considered combining pairs of actor IDs to narrow it down, but I don't think that would narrow down the movies returned by enough.

How can I efficiently make this query?