sergiotapia / magnetissimo

Web application that indexes all popular torrent sites, and saves it to the local database.
MIT License
3k stars 190 forks source link

Search capabilities need to be expanded #54

Closed yaroto98 closed 6 years ago

yaroto98 commented 7 years ago

When searching for a tv episode using the typical nomenclature (example: "Magicians s02e01") doesn't catch all the results it should. I believe this is because the search is looking for the exact string entered, not performing a proper search of multiple strings. The example "Magicians s02e01" won't hit on "Magicians US s02e01" because of the "US".

Example of searching just "Magicians" so you can see all the available s02e01 torrents. screenshot from 2017-01-30 08-35-48

Results of searching "Magicians s02e01" screenshot from 2017-01-30 08-39-41

sergiotapia commented 7 years ago

Yes, right now we're matching on the entire string.

results =
  from t in Torrent,
  where: ilike(t.name, ^"%#{params["term"]}%"),
  order_by: [desc: :inserted_at]

I'll tweak it. I think I'll have to split the term on space, and add multiple where statements. We'll see.

yaroto98 commented 7 years ago

Yea, that's probably the quickest and easiest way to do it. Alternatively we could set up Full Text Search for that field. It'd be more setup, but probably a lot easier to maintain in the long run.

trigun0x2 commented 7 years ago

Have you guys taken a look at fuzzystrmatch and pg_trgm?

Elly6 commented 7 years ago

Can we change the "inserted_at" variable to something else? What other sorting options are available? I'm trying to show most seeded torrents at top. https://github.com/sergiotapia/magnetissimo/issues/36

yaroto98 commented 7 years ago

If you replace "inserted_at" with "seeders" you will show most seeded torrents at top.

file: web/controllers/page_controller.ex

sergiotapia commented 7 years ago

I'll add sortable table headers tonight so you'll be able to sort within the app itself, ez-pz. 😄

tchoutri commented 6 years ago

Closed in favour of this future feature. It's in the pipeline :)