Υποστήριξη για το The Movie Database

Hey Guys,

Having a strange problem here. Take a look at these results: https://api.themoviedb.org/3/discover/movie?api_key=[APIKEYHERE]&language=en&sort_by=vote_average.desc&include_adult=false

The second result is "Dancing With Danger". Now take a look at that same query used in my app: https://ibb.co/dZiFHa

The URL pasted above is taken directly from the following method's output:

public static URL buildUrl(String sortParam, String languageParam) {
        Uri builtUri = Uri.parse(BASE_URL).buildUpon()
                .appendQueryParameter(API_KEY_PARAM, API_KEY)
                .appendQueryParameter(LANGUAGE_PARAM, languageParam)
                .appendQueryParameter(SORT_PARAM, sortParam)
                .appendQueryParameter(ADULT_FILTER, ADULT_FILTER_VALUE)
                .build();

        URL url = null;
        try {
            url = new URL(builtUri.toString());
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        Log.e("URL", url.toString());
        return url;
    }

Not entirely sure what's happening here... Any thoughts? When sorting by popularity, my app generates the correct list of movies. Happy to provide more code upon request. Movie titles/images are being loaded into a RecyclerView.

EDIT: Moved to correct category, additional info added.

4 απαντήσεις(στη σελίδα 1 από 1)

Jump to last post

Hi Michael,

There's no secondary sort index being used to sort so in this case, when there's hundreds (thousands?) of items that have the same vote_average, Elasticsearch doesn't have any way of guaranteeing the order. Best I can tell, it's just a runtime calculation.

It's nothing to do with your app, or your browser. Refresh either one enough times and you'll see the orders shift around slightly.

In order for me to fix this I would need to have a secondary sort index, ie. a "tie breaker". I've created a new ticket for this here. Although I am not sure when I'll have time to look at it.

Hey Travis!

Thanks so much for the answer. Increasing the vote_count.gte solves this issue nicely. I'm happy for you to close the ticket you opened :)

Happy to help! You're welcome.

This should have been fixed a few weeks ago, I just forgot to post an update about it. Sorting now uses secondary indexes to guarantee sort order consistency when there's a tie.

Δεν μπορείτε να βρείτε κάποια ταινία ή σειρά; Συνδεθείτε για να τη δημιουργήσετε.

Σε όλες τις σελίδες

s Εστίαση στη μπάρα αναζήτησης
p Άνοιγμα μενού προφίλ
esc Κλείσιμο ανοιχτού παραθύρου
? Άνοιγμα παραθύρου συντομεύσεων πληκτρολογίου

Στις σελίδες μέσων

b Επιστροφή στην προηγούμενη σελίδα(ή στην αρχική σελίδα όταν είναι εφικτό)
e Μετάβαση στη σελίδα επεξεργασίας

Στις σελίδες κύκλων σειρών

(Δεξιό βέλος) Μετάβαση στον επόμενο κύκλο
(Αριστερό βέλος) Μετάβαση στον προηγούμενο κύκλο

Στις σελίδες επεισοδίων σειρών

(Δεξιό βέλος) Μετάβαση στο επόμενο επεισόδιο
(Αριστερό βέλος) Μετάβαση στο προηγούμενο επεισόδιο

Σε όλες τις σελίδες εικόνων

a Άνοιγμα παραθύρου προσθήκης εικόνας

Σε όλες τις σελίδες επεξεργασίας

t Άνοιγμα επιλογέα μετάφρασης
ctrl+ s Υποβολή φόρμας

Στις σελίδες συζήτησης

n Δημιουργία νέας συζήτησης
w Ρύθμιση κατάστασης παρακολούθησης
p Ρύθμιση ως δημόσια/ιδιωτική
c Ρύθμιση ανοίγματος/κλεισίματος
a Άνοιγμα δραστηριότητας
r Απάντηση στη συζήτηση
l Μετάβαση στην τελευταία απάντηση
ctrl+ enter Υποβολή μηνύματος
(Δεξιό βέλος) Επόμενη σελίδα
(Αριστερό βέλος) Προηγούμενη σελίδα

Ρυθμίσεις

Θέλετε να αξιολογήσετε ή να προσθέσετε αυτό το στοιχείο σε μια λίστα;

Σύνδεση