siblount / PMForDAZ

A product manager for DAZ Studio that accepts common archive structures.
Other
11 stars 2 forks source link

Sorting issues w/ SQLite Database #17

Open siblount opened 1 year ago

siblount commented 1 year ago

Apparently, sorting in SQLite is tougher than I thought. Not only that, attempting to preview the changes w/ a SQLite DB viewer program, such as, DB Browser for SQLite, yields different results compared to what Daz Product Installer has.

For sorting by "Relevance", DB Browser results are different compared to ours.

Additionally, the results that are received from the SQLite engine are in reverse order and even after ORDER BY DESC/ASC, still returns in the same order.

I'm not sure what the issue is, but sooner or later either I or someone else will fix.

If you are willing to take a look at the queries being made, you can find it here.

siblount commented 9 months ago

I don't know why this is happening. On another note, a better relevance solution was found using virtual tables. Unfortunately, virtual tables has a limitation where you cannot use triggers on them which is critical for us, unless we make our own makeshift trigger.

Alternatively, we could just get all the results from the database and handle our own relevance code versus letting the SQLite engine do it's magic (or something among those lines).