Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

14 commits

Auteur SHA1 Message Date
tomleb
e60eceba63 Reduce number of queries, update systemd unit service (#925)
* Update/add systemd services

* Avoid roundtrip back to postgresql when doing ES search

* Use only one ES client
2017-06-05 11:33:02 +10:00
akuma06
61a0ab0bc3 Added also a maxage field
Now you can provide ?maxage=nb_days to get the torrents from the last
nb_days days
2017-06-02 16:25:45 +02:00
akuma06
f41f2c3a25 Field Date Filter
* Search can be filtered out with ?fromDate=2017-05-01 and
?toDate=2017-05-12
2017-06-02 16:10:31 +02:00
tomleb
ba683c3bcb Improve search and fix '*' in search box (#871)
* Improve ES search

The new performance is very good.
Some examples on my 1.5gb vm:
INFO[0153] Query 'shingeki' took 6 milliseconds.
INFO[0125] Query 'アニメ' took 17 milliseconds.
INFO[0102] Query 'shingeki -kyojin horrible ' took 12 milliseconds

Looking at the criteria we wanted here:
https://pad.riseup.net/p/i8DrilHDWRvf, it meets:

1. Fast: sub-100ms for a typical query, sub-50ms is good and sub-20ms is
optimal
2. Prefix match: "horrible" finds horriblesubs
3. Substring match? "アニメ" finds "TVアニメ"
4. Position-independent terms ("shingeki kyojin" finds the same as
"kyojin shingeki")
5. Works with short term lengths correctly and fast (no in "kyoukai no
kanata", 04 in "horrible shingeki 04" etc)
7. (nice to have) search negation: shingeki kyojin -horriblesubs

* Use match_all query instead of *, fix *
2017-06-01 08:38:29 +10:00
akuma06
5376b9e271 New config files (#854)
* New config files

As decided, config files are parsed at runtime.
I decided to go for YAML config files because there can be comments in
it.
There are 2 files:
* config/default_config.yml <= which shouldn't be edited unless we add a
config parameter
* config/config.yml <= which is the user-defined config. This file
shouldn't be commited

Changed every call to config.XXX to config.Conf.XXX (look to the new
stucture of config in config/types.go)

Of course, putting config parameters in config.yml overrides config in
config_default.yml. You don't have to put everything in it, just add
what you want to override.

* Fixing test

Replacing conf.New by config.Conf

* Fixing call to config.Conf to config.Config{} in test files

* Might have fixed testing with this

Printf instead of Fatalf

* Renaming config.yml in example file

* Forbid commiting config.yml

* Should be now fixed

* Do not need this file anymore
2017-05-30 21:21:57 -05:00
akuma06
b5476c7d66 Merge remote-tracking branch 'refs/remotes/origin/dev' into xhr-torrent-refresh 2017-05-30 14:19:13 +02:00
akuma06
b0cf17c77c Renamed the search argument FromID instead of TorrentID 2017-05-30 14:12:42 +02:00
tomleb
6b90f21207 Use old nyaa behavior for FilterRemakes 2017-05-29 20:15:49 -04:00
akuma06
402fce9f02 Api Last Torrent + xhr automatic refresh
* Added a fiel torrentID in search param
* Search can be limited to torrentID > id provided
* Templates creation through simple JS object
* XHR management through simple JS object
* Torrents object that interface with Templates and Query to get new
torrent uploaded according to the search context
2017-05-30 00:28:21 +02:00
tomleb
aeb1b5e69e Fix uploader id search missing space 2017-05-27 09:07:10 -04:00
tomleb
d6c50f5640 TorrentJSON.ID is uint now, fix weird page sorting (#769)
* TorrentJSON.ID is uint now, fix weird page sorting

The bug was that ES would sort by ID in a weird manner because the id
was a string. The id is now a uint.

* Resolved the conflict for future merging
2017-05-27 11:54:41 +10:00
tomleb
f22d11b35d Elasticsearch integration (WIP) (#730)
* Update mapping to be similar to TorrentJSON

* Implement ES search for TorrentParam

* Add seeders/leechers/completed to es index

* Fix filter, use analyzer

* Use ES for the search route

* Add upload_id filtering with ES

* Create/update ES index on torrent upload/update

* Delete from ES index on Delete

* Use ES everywhere, fallback to postgres query

Use Elasticsearch to search the index whenever a call to searchByQuery
is made. Big cleanup needed, but _it werks_.

* Only fetch ids from ES, nothing else

* Use ColumnUpdate instead of Save

* Add FIXME/info to search

* Template needs []TorrentJSON not []Torrent
2017-05-26 09:48:14 +10:00
Eliot Whalan
b4b1b1c26a
go fmt all the code 2017-05-24 17:11:13 +10:00
Jeff Becker
431a0c3748 add new db interface beginnings 2017-05-14 19:31:17 -04:00