question

Jordan Parkinson avatar image
Jordan Parkinson asked

Playfab Search OrderBy Relevance

Hey there!

I have around 2000 UGC items in my game that players can upload and share with others. I have come to notice that many players like to name their creations based on elemental properties (eg. "Fire Sword" for a red sword). This leads to 10+ items named exactly "Fire Sword", but with vastly different descriptions.

I am just curious how the search OrderBy Relevance is determined? From my own experience, it is the item's name that is the sole factor in relevance, but I can't then determine the priority of other factors eg. descriptions or display properties etc.

Any help would be greatly appreciated, thank you! :)

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kylemc@microsoft.com avatar image
kylemc@microsoft.com answered

You're discussing two concepts here that are worth discussing separately; Ordering and Relevance.

Ordering is predictable when you call SearchItems without a Search term. As Neils describes, there's a well-known ordering algorithm. While ordering by Id is predictable, it isn't very useful. Consider whether you want to show things like "new items" or "highly-rated items" and adjust the OrderBy parameter to suit your needs.

Relevancy is harder to predict. It combines input from Title, Description, Keywords, and any DisplayProperties you configure as "Searchable Strings". It can also factor in things like Rating if you put those in the OrderBy clause, but it's much harder to know exactly why it's returning what it is.

Here's a write up of some of the tech used in determining Relevance.

https://learn.microsoft.com/en-us/azure/search/index-similarity-and-scoring

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jordan Parkinson avatar image Jordan Parkinson commented ·

Amazing! Thank you so much for your response Kyle!

Is there a specific scoring profile for Playfab searches, that would be super helpful in understand what limits we should put in place for UGC creation?

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com Jordan Parkinson commented ·

I don't have a specific profile to share. We're always looking for ways to improve relevancy in our default product and may update the profile from time to time. In general, the more data you provide in the fields I listed, the more differentiated your items become and the better a scoring algorithm works. If your items only provide the Title "Fire Sword", there isn't a whole lot a search algorithm can do.

0 Likes 0 ·
Neils Shi avatar image
Neils Shi answered

The order of search results is determined by the parameter “OrderBy” which you set in the API SearchItems’s request body. For more info, you can refer to Search - PlayFab | Microsoft Learn. And our document also mentions that “If no OrderBy value is passed, a default id asc value is used.” So, if you don’t set the “OrderBy” parameter, the results of search are sorted in ascending order by item ID.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jordan Parkinson avatar image Jordan Parkinson commented ·

Hey! Thank you so much for your answer.

I have the API request to search OrderBy Relevance. That was what my question was referring to; how the 'relevance' is determined between pieces of content. Sorry for the confusion!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.