coreproject-moe / CoreProject

Imagine a new platform
GNU Affero General Public License v3.0
115 stars 22 forks source link

Enhance Filtering #113

Closed baseplate-admin closed 2 years ago

baseplate-admin commented 2 years ago

So we need a filter based search system :)

See this for more info

We need to add it here

baseplate-admin commented 2 years ago

I will be working on this :)

baseplate-admin commented 2 years ago

@AKindWorld Hey listen,

I have added the search functionality. But this works like this.

When you query the search parameter, it will do a anime_name and anime_name_japanese lookup. So essentially if you search for One Piece it will look through the database and check if any anime name ( English / Japanese ) has One Piece in it and then returns the result.

So you think we need more functionality from this search feature ?

AKindWorld commented 2 years ago

I think that's just about okay for now. As long as it works for middle values too (example: per Second for 5 Centimeters per Second), or symbol ones too (cm/s for 5 Centimeters per second), it should cover pretty much all of it. If it searches the database for alternate names, then this shouldn't be a problem (like Silver Soul for Gintama).

I'll design the search mockup soon too; it'll be pretty simple for now. If needed, later on, we should be able to add advanced search functionality.

baseplate-admin commented 2 years ago

I'll design the search mockup soon too; it'll be pretty simple for now. If needed, later on, we should be able to add advanced search functionality.

I actually some of the search functions available.

I think that's just about okay for now. As long as it works for middle values too (example: per Second for 5 Centimeters per Second), or symbol ones too (cm/s for 5 Centimeters per second), it should cover pretty much all of it.

But its not as advanced as this. I will take a look into this

baseplate-admin commented 2 years ago

For now if we do http://127.0.0.1:8000/api/v1/anime/?anime=&genre=action%2Ccomedy%2Csci-fi&themes=&studios=&producer=Bandai+Visual query. It will return

{
  "count": 8,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 2,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 2,
          "name": "Adventure",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 14,
          "name": "Sunrise",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1,
      "anime_name": "Cowboy Bebop",
      "anime_name_japanese": "カウボーイビバップ",
      "anime_source": "Original",
      "anime_aired_from": "1998-04-03T00:00:00Z",
      "anime_aired_to": "1999-04-24T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1.webp",
      "anime_synopsis": "Crime is timeless. By the year 2071, humanity has expanded across the galaxy, filling the surface of other planets with settlements like those on Earth. These new societies are plagued by murder, drug use, and theft, and intergalactic outlaws are hunted by a growing number of tough bounty hunters. Spike Spiegel and Jet Black pursue criminals throughout space to make a humble living. Beneath his goofy and aloof demeanor, Spike is haunted by the weight of his violent past. Meanwhile, Jet manages his own troubled memories while taking care of Spike and the Bebop, their ship. The duo is joined by the beautiful con artist Faye Valentine, odd child Edward Wong Hau Pepelu Tivrusky IV, and Ein, a bioengineered Welsh Corgi. While developing bonds and working to catch a colorful cast of criminals, the Bebop crew's lives are disrupted by a menace from Spike's past. As a rival's maniacal plot continues to unravel, Spike must choose between life with his newfound family or revenge for his old wounds. [Written by MAL Rewrite]",
      "anime_background": "When Cowboy Bebop first aired in spring of 1998 on TV Tokyo, only episodes 2, 3, 7-15, and 18 were broadcast, it was concluded with a recap special known as Yose Atsume Blues. This was due to anime censorship having increased following the big controversies over Evangelion, as a result most of the series was pulled from the air due to violent content. Satellite channel WOWOW picked up the series in the fall of that year and aired it in its entirety uncensored. Cowboy Bebop was not a ratings hit in Japan, but sold over 19,000 DVD units in the initial release run, and 81,000 overall. Protagonist Spike Spiegel won Best Male Character, and Megumi Hayashibara won Best Voice Actor for her role as Faye Valentine in the 1999 and 2000 Anime Grand Prix, respectively. Cowboy Bebop's biggest influence has been in the United States, where it premiered on Adult Swim in 2001 with many reruns since. The show's heavy Western influence struck a chord with American viewers, where it became a \"gateway drug\" to anime aimed at adult audiences.",
      "anime_rating": "R - 17+ (violence & profanity)",
      "updated": "2022-03-29T06:31:19.725735Z"
    },
    {
      "id": 2,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 2,
          "name": "Adventure",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 14,
          "name": "Sunrise",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1,
      "anime_name": "Cowboy Bebop",
      "anime_name_japanese": "カウボーイビバップ",
      "anime_source": "Original",
      "anime_aired_from": "1998-04-03T00:00:00Z",
      "anime_aired_to": "1999-04-24T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1.webp",
      "anime_synopsis": "Crime is timeless. By the year 2071, humanity has expanded across the galaxy, filling the surface of other planets with settlements like those on Earth. These new societies are plagued by murder, drug use, and theft, and intergalactic outlaws are hunted by a growing number of tough bounty hunters. Spike Spiegel and Jet Black pursue criminals throughout space to make a humble living. Beneath his goofy and aloof demeanor, Spike is haunted by the weight of his violent past. Meanwhile, Jet manages his own troubled memories while taking care of Spike and the Bebop, their ship. The duo is joined by the beautiful con artist Faye Valentine, odd child Edward Wong Hau Pepelu Tivrusky IV, and Ein, a bioengineered Welsh Corgi. While developing bonds and working to catch a colorful cast of criminals, the Bebop crew's lives are disrupted by a menace from Spike's past. As a rival's maniacal plot continues to unravel, Spike must choose between life with his newfound family or revenge for his old wounds. [Written by MAL Rewrite]",
      "anime_background": "When Cowboy Bebop first aired in spring of 1998 on TV Tokyo, only episodes 2, 3, 7-15, and 18 were broadcast, it was concluded with a recap special known as Yose Atsume Blues. This was due to anime censorship having increased following the big controversies over Evangelion, as a result most of the series was pulled from the air due to violent content. Satellite channel WOWOW picked up the series in the fall of that year and aired it in its entirety uncensored. Cowboy Bebop was not a ratings hit in Japan, but sold over 19,000 DVD units in the initial release run, and 81,000 overall. Protagonist Spike Spiegel won Best Male Character, and Megumi Hayashibara won Best Voice Actor for her role as Faye Valentine in the 1999 and 2000 Anime Grand Prix, respectively. Cowboy Bebop's biggest influence has been in the United States, where it premiered on Adult Swim in 2001 with many reruns since. The show's heavy Western influence struck a chord with American viewers, where it became a \"gateway drug\" to anime aimed at adult audiences.",
      "anime_rating": "R - 17+ (violence & profanity)",
      "updated": "2022-03-29T06:31:19.725735Z"
    },
    {
      "id": 2,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 2,
          "name": "Adventure",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 14,
          "name": "Sunrise",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1,
      "anime_name": "Cowboy Bebop",
      "anime_name_japanese": "カウボーイビバップ",
      "anime_source": "Original",
      "anime_aired_from": "1998-04-03T00:00:00Z",
      "anime_aired_to": "1999-04-24T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1.webp",
      "anime_synopsis": "Crime is timeless. By the year 2071, humanity has expanded across the galaxy, filling the surface of other planets with settlements like those on Earth. These new societies are plagued by murder, drug use, and theft, and intergalactic outlaws are hunted by a growing number of tough bounty hunters. Spike Spiegel and Jet Black pursue criminals throughout space to make a humble living. Beneath his goofy and aloof demeanor, Spike is haunted by the weight of his violent past. Meanwhile, Jet manages his own troubled memories while taking care of Spike and the Bebop, their ship. The duo is joined by the beautiful con artist Faye Valentine, odd child Edward Wong Hau Pepelu Tivrusky IV, and Ein, a bioengineered Welsh Corgi. While developing bonds and working to catch a colorful cast of criminals, the Bebop crew's lives are disrupted by a menace from Spike's past. As a rival's maniacal plot continues to unravel, Spike must choose between life with his newfound family or revenge for his old wounds. [Written by MAL Rewrite]",
      "anime_background": "When Cowboy Bebop first aired in spring of 1998 on TV Tokyo, only episodes 2, 3, 7-15, and 18 were broadcast, it was concluded with a recap special known as Yose Atsume Blues. This was due to anime censorship having increased following the big controversies over Evangelion, as a result most of the series was pulled from the air due to violent content. Satellite channel WOWOW picked up the series in the fall of that year and aired it in its entirety uncensored. Cowboy Bebop was not a ratings hit in Japan, but sold over 19,000 DVD units in the initial release run, and 81,000 overall. Protagonist Spike Spiegel won Best Male Character, and Megumi Hayashibara won Best Voice Actor for her role as Faye Valentine in the 1999 and 2000 Anime Grand Prix, respectively. Cowboy Bebop's biggest influence has been in the United States, where it premiered on Adult Swim in 2001 with many reruns since. The show's heavy Western influence struck a chord with American viewers, where it became a \"gateway drug\" to anime aimed at adult audiences.",
      "anime_rating": "R - 17+ (violence & profanity)",
      "updated": "2022-03-29T06:31:19.725735Z"
    },
    {
      "id": 15,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 18,
          "name": "Mecha",
          "type": "anime"
        },
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 6,
          "name": "Gainax",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1002,
      "anime_name": "Top wo Nerae 2! Diebuster",
      "anime_name_japanese": "トップをねらえ2!DIEBUSTER",
      "anime_source": "Original",
      "anime_aired_from": "2004-10-03T00:00:00Z",
      "anime_aired_to": "2006-08-25T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1002.webp",
      "anime_synopsis": "Generations have passed since the war with the Space Monsters started, and none remain who know how it began, with even records of those times being scarce. It is a lost cause, but humanity still fights against them, relying on the \"Topless\": a group of elite space pilots with special powers that allow them to use the Buster Machines—the last hope against the Space Monsters. Nono, a girl from a remote Martian town, has heard tales all her life of the legendary pilot \"Nono-Riri,\" and wants nothing more than to leave her humble life behind and follow in the footsteps of her idol. Though she has no idea of the dangers that lie ahead, nothing will stop her from achieving her dream. While Nono is down on her luck, she chances upon the lonesome Topless pilot Lal'C Melk Mark, and decides to stake her entire future on following Lal'C, no matter the cost. [Written by MAL Rewrite]",
      "anime_background": null,
      "anime_rating": "R+ - Mild Nudity",
      "updated": "2022-03-29T06:31:40.841179Z"
    },
    {
      "id": 15,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 18,
          "name": "Mecha",
          "type": "anime"
        },
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 6,
          "name": "Gainax",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1002,
      "anime_name": "Top wo Nerae 2! Diebuster",
      "anime_name_japanese": "トップをねらえ2!DIEBUSTER",
      "anime_source": "Original",
      "anime_aired_from": "2004-10-03T00:00:00Z",
      "anime_aired_to": "2006-08-25T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1002.webp",
      "anime_synopsis": "Generations have passed since the war with the Space Monsters started, and none remain who know how it began, with even records of those times being scarce. It is a lost cause, but humanity still fights against them, relying on the \"Topless\": a group of elite space pilots with special powers that allow them to use the Buster Machines—the last hope against the Space Monsters. Nono, a girl from a remote Martian town, has heard tales all her life of the legendary pilot \"Nono-Riri,\" and wants nothing more than to leave her humble life behind and follow in the footsteps of her idol. Though she has no idea of the dangers that lie ahead, nothing will stop her from achieving her dream. While Nono is down on her luck, she chances upon the lonesome Topless pilot Lal'C Melk Mark, and decides to stake her entire future on following Lal'C, no matter the cost. [Written by MAL Rewrite]",
      "anime_background": null,
      "anime_rating": "R+ - Mild Nudity",
      "updated": "2022-03-29T06:31:40.841179Z"
    },
    {
      "id": 15,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 1,
          "name": "Action",
          "type": "anime"
        },
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 24,
          "name": "Sci-Fi",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 18,
          "name": "Mecha",
          "type": "anime"
        },
        {
          "mal_id": 29,
          "name": "Space",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 6,
          "name": "Gainax",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1002,
      "anime_name": "Top wo Nerae 2! Diebuster",
      "anime_name_japanese": "トップをねらえ2!DIEBUSTER",
      "anime_source": "Original",
      "anime_aired_from": "2004-10-03T00:00:00Z",
      "anime_aired_to": "2006-08-25T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1002.webp",
      "anime_synopsis": "Generations have passed since the war with the Space Monsters started, and none remain who know how it began, with even records of those times being scarce. It is a lost cause, but humanity still fights against them, relying on the \"Topless\": a group of elite space pilots with special powers that allow them to use the Buster Machines—the last hope against the Space Monsters. Nono, a girl from a remote Martian town, has heard tales all her life of the legendary pilot \"Nono-Riri,\" and wants nothing more than to leave her humble life behind and follow in the footsteps of her idol. Though she has no idea of the dangers that lie ahead, nothing will stop her from achieving her dream. While Nono is down on her luck, she chances upon the lonesome Topless pilot Lal'C Melk Mark, and decides to stake her entire future on following Lal'C, no matter the cost. [Written by MAL Rewrite]",
      "anime_background": null,
      "anime_rating": "R+ - Mild Nudity",
      "updated": "2022-03-29T06:31:40.841179Z"
    },
    {
      "id": 18,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 22,
          "name": "Romance",
          "type": "anime"
        },
        {
          "mal_id": 37,
          "name": "Supernatural",
          "type": "anime"
        }
      ],
      "anime_themes": [],
      "anime_studios": [
        {
          "mal_id": 48,
          "name": "AIC",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        }
      ],
      "mal_id": 1003,
      "anime_name": "Aa! Megami-sama! (TV) Specials",
      "anime_name_japanese": "ああっ女神さまっ",
      "anime_source": "Manga",
      "anime_aired_from": "2005-04-01T00:00:00Z",
      "anime_aired_to": "2005-12-23T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/1003.webp",
      "anime_synopsis": "Due to the recent events that happened on the last episodes of the season, the Goddess have some stability problems with their body systems. The always adult looking Urd becomes a little girl and has a fateful encounter with a boy, whereas little Skuld becomes an adult and wants to experiment adulthood together with Keiichi.",
      "anime_background": null,
      "anime_rating": "PG-13 - Teens 13 or older",
      "updated": "2022-03-29T06:31:45.451937Z"
    },
    {
      "id": 9,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 37,
          "name": "Supernatural",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 20,
          "name": "Parody",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 456,
          "name": "Lerche",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 23,
          "name": "Bandai Visual",
          "type": "anime"
        },
        {
          "mal_id": 703,
          "name": "Notes",
          "type": "anime"
        }
      ],
      "mal_id": 10012,
      "anime_name": "Carnival Phantasm",
      "anime_name_japanese": "カーニバル・ファンタズム",
      "anime_source": "Manga",
      "anime_aired_from": "2011-08-14T00:00:00Z",
      "anime_aired_to": "2011-12-31T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/10012.webp",
      "anime_synopsis": "The Carnival Moment is a time when several narratives from Type-Moon's famous works intersect. It happens every decade in an entirely new dimension, and those who have never run into each other can meet. And what's more, all individuals involved gain the opportunity to fulfill any of their wishes! However, they will have to come a long way, as they will need to partake in contests. In Carnival Phantasm, various characters are put into situations that ridicule their own worlds. Nevertheless, they all have the same objective: to win the contests by any means necessary! [Written by MAL Rewrite]",
      "anime_background": "Carnival Phantasm was made in celebration of Type-Moon's 10th anniversary.",
      "anime_rating": "PG-13 - Teens 13 or older",
      "updated": "2022-03-29T06:31:31.487981Z"
    }
  ]
}
baseplate-admin commented 2 years ago

As long as it works for middle values too (example: per Second for 5 Centimeters per Second), or symbol ones too (cm/s for 5 Centimeters per second), it should cover pretty much all of it.

I actually dont have a good idea on how to achieve this other than to map cm/s to centimeter per second which will get really tiresome as the number of mapping increases.

For now we are doing something like this.

  1. You search for Gin
  2. If anime.name contains Gin return it.

This makes searching a bit easier :) ( in my opinion )

AKindWorld commented 2 years ago

I actually dont have a good idea on how to achieve this other than to map cm/s to centimeter per second which will get really tiresome as the number of mapping increases.

I think the only solution is to map alternate names to every entry as hidden parameters. Like how AniList has separate fields for Synonyms for every anime that has alternate names.

image

I dunno if this is possible easily though. We can probably get this data from the API?

image

Anyways, don't push yourself on it. We can always expand it later on :)

baseplate-admin commented 2 years ago
        return queryset.filter(
            Q(anime_name_japanese__icontains=value)
            | Q(anime_name__icontains=value)
            | Q(anime_name_synonyms__name__icontains=value)
        )

With this finished the advanced search algorithm is finished. Thanks @AKindWorld.

Although this image is seriously wrong.The actual relation is anime_title_synonyms

baseplate-admin commented 2 years ago

Now with http://127.0.0.1:8000/api/v1/anime/?anime=Shin+Shirayuki-hime+Densetsu+Pretear&genre=&themes=&studios=&producer=

The return is :

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 95,
      "anime_episodes": [],
      "anime_genres": [
        {
          "mal_id": 4,
          "name": "Comedy",
          "type": "anime"
        },
        {
          "mal_id": 8,
          "name": "Drama",
          "type": "anime"
        },
        {
          "mal_id": 10,
          "name": "Fantasy",
          "type": "anime"
        },
        {
          "mal_id": 22,
          "name": "Romance",
          "type": "anime"
        }
      ],
      "anime_themes": [
        {
          "mal_id": 31,
          "name": "Super Power",
          "type": "anime"
        }
      ],
      "anime_studios": [
        {
          "mal_id": 34,
          "name": "Hal Film Maker",
          "type": "anime"
        }
      ],
      "anime_producers": [
        {
          "mal_id": 113,
          "name": "Kadokawa Shoten",
          "type": "anime"
        },
        {
          "mal_id": 160,
          "name": "Rondo Robe",
          "type": "anime"
        }
      ],
      "anime_name_synonyms": [
        {
          "name": "Shin Shirayuki-hime Densetsu Pretear"
        }
      ],
      "mal_id": 100,
      "anime_name": "Shin Shirayuki-hime Densetsu Prétear",
      "anime_name_japanese": "新白雪姫伝説プリーティア",
      "anime_source": "Manga",
      "anime_aired_from": "2001-04-04T00:00:00Z",
      "anime_aired_to": "2001-06-27T00:00:00Z",
      "anime_cover": "http://127.0.0.1:8000/media/anime_cover/100.webp",
      "anime_synopsis": "Due to her father's remarriage, robust 16-year-old Himeno Awayuki moves into a large mansion with a beautiful garden—the quintessential dream house for any girl her age. However, much to Himeno's disappointment, her new stepfamily doesn't really seem to like her, as her stepmother often occupies herself with her father, her younger stepsister Mawata ignores her, and her other stepsister—the equally aged Mayune—tries to prank her at every opportunity. But Himeno doesn't have time to dwell into thoughts of hopelessness—her new life has now become involved with a group of seven magical boys known as the Leafe Knights, after they ask her to become a magical princess who can borrow their powers! Although Himeno accepts their request and becomes the Prétear, she feels doubtful in her abilities to protect the world and its Leafe, the source of energy for all life. Will Himeno be able to find happiness among her new family and also save the Earth from the enemy, the Princess of Disaster? [Written by MAL Rewrite]",
      "anime_background": null,
      "anime_rating": "PG-13 - Teens 13 or older",
      "updated": "2022-03-29T09:40:36.636493Z"
    }
  ]
}
baseplate-admin commented 2 years ago

Have any more idea on improvement ? @AKindWorld ? If not i will let you close the issue :)

AKindWorld commented 2 years ago

wow, am glad it worked!

Not an idea, but does our search give instant results? Or does it work after an enter/press field? Instant results are better from a UX point of view techically, since it saves some clicks and load times.

baseplate-admin commented 2 years ago

image

It takes about 3 sec to get a list of 10 animes based on relevant query. But this can be further optimized to 10 ms.

Instant results are better from a UX point of view techically, since it saves some clicks and load times.

Thats my goal too. But once in a while if the query is very unique, someone has to wait around 3 sec before the response load

baseplate-admin commented 2 years ago

image

Some minor improvements on the serializing part. ( About 20% )

I think i found the problem. I am doing way too much serialization on python. I am going to reduce it :) ( I took a look and its already in master )

baseplate-admin commented 2 years ago

image

So with some indexing i am able to make it 135 miliseconds. I dont think we need to get faster than this :)

baseplate-admin commented 2 years ago

Capture

With just only postgres we saw 2 seconds :) So yea SQLite is slow. but the main factor was DEBUG=False in settings.py

AKindWorld commented 2 years ago

Good job @baseplate-admin!

I think that's pretty much all that we need for now.

baseplate-admin commented 2 years ago

@AKindWorld The latest changes image