icssc / anteater-api

API that provides easy access to public data from UC Irvine. Developed for Anteaters, by Anteaters.
https://anteaterapi.com/reference
GNU Affero General Public License v3.0
3 stars 0 forks source link

Search rankings are broken #14

Closed ecxyzzy closed 3 weeks ago

ecxyzzy commented 3 weeks ago

Expected Behavior

Search results should be listed in descending order of relevance score, then by ascending lexicographic ordering of the object's ID for objects with the same score.

Current Behavior

In production, results for "art" are ranked like this:

    "data": {
        "search": [
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "adlander"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "aeweis"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "asdevany"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "aturk"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "cwhiting"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "gcbauer"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "homoumi"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "jchooran"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "jdherb"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "lfbauer"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "mcdaviso"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "robeye"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Instructor",
                    "ucinetid": "varthi"
                },
                "rank": 0.24317084
            },
            {
                "result": {
                    "__typename": "Course",
                    "id": "ART106A"
                },
                "rank": 1.0334761
            },
            { "...": "more course results" }
        ]
    }
}

Cannot be reproduced locally probably due to the smaller sample size.

Possible Solution

Sort results in JS-space.