دعم الموقع

is there a way to sort any query in a certain order that is different from what the query returns? for example, alphabetical, or by release date, etc.

4 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Hi vshwnth2,

You can't sort search results but you can sort the discover pages. Here's an example of movies that are rated PG-13 or less sorted by popularity:

http://api.themoviedb.org/3/discover/movie?api_key=###&certification_country=US&certification.lte=PG-13&sort_by=popularity.desc

You can read more here: http://docs.themoviedb.apiary.io/#discover

Cheers.

I'm also interested in this use case. For instance, when using search/multi for "Star Wars", we get 77 results split across four pages. However, 80%+ of the time, the user is looking for "Star Wars: Episode IV - A New Hope" (id 11), and that is pretty easy to pick out as a top result when considering the popularity and vote_count values. Unfortunately, it is not the top result in search and I don't want to have to pull all search result pages in order to sort. What should I do here?

Hi joshjordan,

Search will never support sorting as it's designed to a sorted 100% by relevance while being boosted by popularity to help narrow results. In this case, "Clone Wars" is above "A New Hope" because the word "Wars" is in the title twice so it's believed to be a much more relevant result.

Search goes incredibly sideways when you don't sort by the calculated Lucene score in ElasticSearch.

As always, the more you type the better the results:

https://api.themoviedb.org/3/search/multi?api_key=###&query=star+wars+n
https://api.themoviedb.org/3/search/multi?api_key=###&query=star+wars+new
https://api.themoviedb.org/3/search/multi?api_key=###&query=star+wars+a+n
https://api.themoviedb.org/3/search/multi?api_key=###&query=star+wars+4

Cheers.

Wow - thanks for your quick reply. Appreciate it, Travis!

I understand what you're saying with regards to relevancy, but real-world relevancy means more than just string matching amongst the movie title(s). In the real-world use cases we've tested, Clone Wars is much less relevant than A New Hope for the query "Star Wars", even though "Wars" appears twice - that's not something the user cares about. We've given the advice to our users to use more specific search terms many times and in many ways, but many people still think "Star Wars" is the right thing to search for, so they just aren't going to do that. I can type "Star Wars A New Hope" no problem, but I'm not concerned with my own use case, I'm concerned with end-user behavior. Lucene and Elasticsearch have powerful weighting functionality to balance string-matched Queries with other relevancy parameters, such as popularity.

I think I agree with your goal here: sorting 100% by relevance, but I am skeptical that the definition of relevance is just focused on search terms, from the perspective of the end-user. Does that make sense?

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول