when people ask for properly working and properly sorted searches
The search is working, and properly sorted. Your problem is that the sorting criteria you want (sorting by last upload
in a specific language [or set of languages]) does not currently exist.
one start wonder wether that was the proper tool for the job or if it was even meant for this kind of job in the first place
One might wonder; however there's a reason why some 9 out of 10 websites implementing a powerful search use Elasticsearch for it. But maybe you know better than us and the entire rest of the industry despite clearly not having worked on the same issue before.
And using SQL searches was also the reason why the search was not even enabled for guests in v3. It is easier to make complicated searches with it, but you will
never pull a fast multi-criteria search like ours (titles, tags, exclusions, various sorts, ...) with raw SQL searches, or you'll have other tradeoffs (needing much more compute, needing indexes on nearly all rows causing terrible writes and massive storage usage, ...).
This is specifically why no one actually does that and instead uses Lucene, Elasticsearch, and others.
Also, from what I understood the database is already sorted by date, you just have to drop the results in a lenguage not in my list
Again, it is entirely irrelevant how the layout of the data is in our database (and there's also no inherent sorting in the database, and the database also doesn't store every manga's last-uploaded-chapter-date-per-language because that would be ludicrous in its own right anyway.
At this point, I can't say if:
- you believe we lie and "hide" a feature that is trivial just for fun, or
- fundamentally misunderstand how it goes together
If it's the former, why? Why would we not if it was that easy and "already there" like you seem to believe? At least come up with a reason why we wouldn't want to offer it, idk. And if it's the latter, you should read
https://mangadex.dev/an-api-to-rule-them-all/#data-caching, which mentions the general way searches are performed.
What REALLY baffles me, is that you ALREADY implemented it for the "latest updates" page, you just need to aggregate the results by title...
It is not at all the same. The latest updates page is a
chapter search. And the reason Elasticsearch allows us to deliver near-instantaneous searches, have it enabled for guests, and so on is specifically because it's a document database. And document databases (most so-called NoSQL databases) make some tradeoffs like generally not supporting JOINs amongst other things. So there's no "just need to aggregate by title". It's literally not a thing nor how to do it.
Instead what we need to do is store, against each manga document (ie in ES, computed at upsert time of the document), a searchable field per-language for the last uploaded chapter data. It is feasible, and as we said many times:
it will happen eventually
Be patient, or at least keep your complaints to yourself if they're going to incoherently boil down to "but you said it 4 times already, but it's trivial and you did it already, and you could do it like that easily"...
We said it will eventually happen, and it will. No we cannot do it how you think we could, or we would already have done so.
If your complaint is purely that it's not yet done: this falls into the (very) long list of things that are doable, but a bit tricky, but we want them and many users also do. That list is filled with good ideas, but days are made of only 24 hours and we all have dayjobs.