Commit graph

277 commits

Author SHA1 Message Date
Mikkel Denker
647044f27d Fixed XSS by not properly escaping search query 2022-10-25 19:26:01 +02:00
Mikkel Denker
e221eb1292 spell correction only highlight corrected part 2022-10-25 10:09:27 +02:00
Mikkel Denker
fd97641eb8
Ftr/trust centrality (#63)
* refactor harmonic centrality into separate centrality module

* betweenness centrality

* betweenness speedup by not using hashmaps

* [WIP] trust centrality

* more robust warc download?

* unit test for trust centrality calculation

* refactor centrality store and also save trust centrality in store

* approx harmonic centrality working

* Order trusted nodes by betweenness, if the user specified too many, merge the worse trusted nodes into some of the better and update their weight

* dislike sites

* re-enable harmonic centrality calculation

* calculate betweenness on full graph

* added nodeid to schema

* use personal centrality during search

* sort centrality values in csv files

* liked and disliked sites in goggles syntax
2022-10-14 13:14:47 +02:00
Oliver Bøving
1d26bb2ec0
Integrate Alpine.js (#64)
* Move settings into a subfolder

This ensures that the paths are layed out the same on the frontend and
on the backend.

* Format goggles and sites .astro

* Add Alpine.js and use `ServeDir` instead of `Spa`

The `ServeDir` allows us the use the public dir and remove the extra
/assets/ also solving the issue with loading scripts without inline.

Currently only a few computes are ported to use Alpine.js, but the rest
should be doable!
2022-10-13 13:09:54 +02:00
Mikkel Denker
677f3a40b1
Ftr/site ranking adjustment (#61)
* gui

* forgot to implement bang in search_server

* added opensearch.xml file

* reduce indexer memory by commiting more often

* fix query parser bug with special characters

* change autosuggest browser url

* remove '#' from url during indexing

* pre-hashed domain field

* we will also have a subscription model without ads

* site query should not match partial domains from tokenization

* ttl cache

* send site rankings from js to backend during search

* apply site rankings during search
2022-10-04 14:16:02 +02:00
Mikkel Denker
a4ecf5c307 merge 2022-09-28 16:05:10 +02:00
Mikkel Denker
963bd3aef7 forgot to implement is_computable_before_search function 2022-09-22 15:06:16 +02:00
Mikkel Denker
b902a3b7aa
Ftr/sort postings by score (#57)
* sort postings by a pre-computed field

* Limit the number of webpages considered for ranking during search.
At the moment we rank top 10 million pages. This can be done since we have sorted the postinglists based on
all pre-computable signals. The chance of "the best" webpage being at > 10 mil is extremely low, and this will allow us to speedup search significantly.
2022-09-22 13:11:54 +02:00
Mikkel Denker
5b4a7cc366 added 'try on {different engine}' buttons 2022-09-22 10:57:33 +02:00
Mikkel Denker
fd3e99ca50 embed all images directly in search page using base64 2022-09-16 13:28:38 +02:00
Oliver Bøving
0b0d453e6f Refactor search page further 2022-09-11 17:08:41 +02:00
Oliver Bøving
4204802b28 Make the main header icon smaller, and improve more responsiveness 2022-09-11 16:01:27 +02:00
Oliver Bøving
30af194bf0 Make search page more responsive 2022-09-11 15:00:20 +02:00
Oliver Bøving
5176802207 Move around some prettier options 2022-09-11 14:20:07 +02:00
Mikkel Denker
51834be843 center entity again 2022-09-11 13:27:20 +02:00
Mikkel Denker
1c57e94687 merge main into branch 2022-09-11 13:27:02 +02:00
Oliver Bøving
0009b79ffd
Use faker data in askama templates during dev (#46)
* Use faker data in askama templates during dev

By adding a `$ {{lorem.limes}}` for example to askama`...` expressions,
fake data is inserted during development.

Additionally all askama specific text (such as {% for x in xs %}) is
not produced during development for cleaner pages.

* Add astro-icons/heroicons and cleanup some styling (#45)

* Add astro-icons/heroicons and cleanup some styling

* Make the header a component
2022-09-11 13:17:11 +02:00
Oliver Bøving
9012236ce6 Add mobile menu and more responsive tweaks 2022-09-11 13:07:03 +02:00
Oliver Bøving
f988616b8f Use faker data in askama templates during dev
By adding a `$ {{lorem.limes}}` for example to askama`...` expressions,
fake data is inserted during development.

Additionally all askama specific text (such as {% for x in xs %}) is
not produced during development for cleaner pages.
2022-09-11 13:07:03 +02:00
Oliver Bøving
5223c57021
Add astro-icons/heroicons and cleanup some styling (#45)
* Add astro-icons/heroicons and cleanup some styling

* Make the header a component
2022-09-11 13:00:53 +02:00
Mikkel Denker
fe5c366949
Ftr/custom goggles (#44)
* approx 1.5x search performance boost

* [WIP] choose goggles from frontend

* font-light by default

* delete icon in goggles

* ability to delete custom goggles

* custom user goggles
2022-09-10 17:27:48 +02:00
Oliver Bøving
4b2a34feb4
Make Montserrat a variable font (#43)
What was missing, was adding it to the tailwind font list
2022-09-10 15:36:12 +02:00
Oliver Bøving
adcaa5ddfb
Refactor askama templating to use function rather then components (#41) 2022-09-10 15:35:19 +02:00
Oliver Bøving
77edf2a1d5
Add brand color to tailwind colors (#42) 2022-09-10 14:39:08 +02:00
Oliver Bøving
059d52c54c
Use fontsource for loading Montserrat (#40)
This commit removes the Montserrat font stored in public and replaces
them with the fonts installed with @fontsource/montserrat.

This also streamlines the font import process, and ensures that correct
typeface formats are loaded.

One thing to consider, is using variable fonts instead. I failed to get
loading with this setup however, but it seems to be supported.
2022-09-10 12:19:30 +02:00
Mikkel Denker
c2b851bb44
Ftr/customized ranking (#38)
* goggles parser

* support weird urls in goggle

* quite significant speedboost during indexing (approx x1.7)

* merge index explicitly in indexer

* query benchmark

* search performance improvements primarily by not using hash during search

* turn goggle into tantivy query

* goggle benchmark

* Goggles are working!!

* fixed bug where goggle would enforce that sitename must be A and B and C etc. instead of A or B or C

* document some more goggle syntax

* less bold search highlights
2022-09-09 12:28:36 +02:00
Oliver Bøving
e1a6e3322d
Build frontend using Astro (#37)
* Build frontend using Astro

This commit replaces the prior pure Askama templates, into templates
statically generated by Astro.

The purpose of this is to enable features such as MD/MDX,
minimization, better Tailwind integration, and JSX'ish component syntax.

In the future a frontend framework, like React, could also be added, while
still compiling the frontend templates statically.

* Delete README.md

* Make the searchbar more round

* Run `npm install` in build.rs

* Fix some image paths

* Make search bar suggestion visibility CSS only

The suggestions are only shown when the input has focus and is not empty

* Add prettier astro and tailwind plugin

* Remove meta astro tag

* Move privacy.astro to privacy-and-happy-lawyers.astro

* Convert privacy and about page to MDX

* Remove old about page

Co-authored-by: Mikkel Denker <Mikkeldenker@gmail.com>
2022-09-09 12:15:53 +02:00