mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
minor formatting cleanup
This commit is contained in:
@@ -5,10 +5,10 @@ export default function fuzzySearch(fileArr, query){
|
||||
const options = {
|
||||
findAllMatches: true,
|
||||
threshold: leniency,
|
||||
ignoreLocation: true,
|
||||
//ignoreLocation: true,
|
||||
includeScore: true,
|
||||
ignoreFieldNorm: true,
|
||||
keys: ['name']
|
||||
//ignoreFieldNorm: true,
|
||||
keys: ['filename']
|
||||
}
|
||||
const fuse = new Fuse(fileArr, options)
|
||||
return fuse.search(query)
|
||||
|
||||
@@ -35,7 +35,9 @@ app.get('/', function(req, res) {
|
||||
|
||||
app.get('/search', function(req, res) {
|
||||
let results = fuzzySearch(fileList, req.query.q)
|
||||
console.log(results)
|
||||
if(process.env.DEBUG = "1"){
|
||||
console.log(results)
|
||||
}
|
||||
res.render('pages/index', {
|
||||
page: 'results',
|
||||
query: req.query.q,
|
||||
|
||||
@@ -29,7 +29,7 @@ _ / / / _ /_/ /_ / _ / / __/ / / / /_
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<%= results[x].item.path %>">
|
||||
<%= results[x].item.name %>
|
||||
<%= results[x].item.filename %>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@@ -42,7 +42,7 @@ _ / / / _ /_/ /_ / _ / / __/ / / / /_
|
||||
<%= results[x].item.date %>
|
||||
</td>
|
||||
<td>
|
||||
<%= 1 - results[x].score %>%
|
||||
<%= (1 - results[x].score).toFixed(2) %>%
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
@@ -14,4 +14,32 @@
|
||||
background-color: #1c2020;
|
||||
color: #fff!important;
|
||||
}
|
||||
a {
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
}
|
||||
tr:hover td {
|
||||
color: #FFFFFF;
|
||||
background: #3D4351;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
td {
|
||||
webkit-transition: background 300ms ease-in;
|
||||
transition-behavior: normal;
|
||||
transition-duration: 300ms;
|
||||
transition-timing-function: ease-in;
|
||||
transition-delay: 0s;
|
||||
transition-property: background;
|
||||
-moz-transition: background 300ms ease-in;
|
||||
-ms-transition: background 300ms ease-in;
|
||||
-o-transition: background 300ms ease-in;
|
||||
transition: background 300ms ease-in;
|
||||
transition-behavior: normal;
|
||||
transition-duration: 300ms;
|
||||
transition-timing-function: ease-in;
|
||||
transition-delay: 0s;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user