Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Citronalco
solr-calibre-websearch
Commits
54e0298a
Commit
54e0298a
authored
Sep 17, 2017
by
Citronalco
Browse files
rename subjects to more calibre-like tags
fix javascript to work on my mobile phone fix scroll-load-finished handling
parent
c594fbf0
Changes
3
Hide whitespace changes
Inline
Side-by-side
indextool/indexer
View file @
54e0298a
...
...
@@ -108,8 +108,8 @@ def parse_metadata(metadata):
'series'
:
series
,
'series_index'
:
series_index
,
'
subject
'
:
subject
,
'
subject
_facet'
:
subject
,
'
tag
'
:
subject
,
'
tag
_facet'
:
subject
,
'abstract'
:
description
,
'abstract_output'
:
description
,
...
...
solr/conf/schema.xml
View file @
54e0298a
...
...
@@ -225,8 +225,8 @@
<field
name=
"series"
type=
"text"
indexed=
"true"
stored=
"true"
/>
<field
name=
"series_index"
type=
"string"
indexed=
"true"
stored=
"true"
/>
<field
name=
"
subject"
type=
"text"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<field
name=
"
subject
_facet"
type=
"string"
indexed=
"true"
stored=
"false"
multiValued=
"true"
/>
<field
name=
"
tag"
type=
"text"
indexed=
"true"
stored=
"true"
multiValued=
"true"
/>
<field
name=
"
tag
_facet"
type=
"string"
indexed=
"true"
stored=
"false"
multiValued=
"true"
/>
<field
name=
"abstract"
type=
"text"
indexed=
"true"
stored=
"false"
multiValued=
"false"
omitNorms=
"false"
/>
<field
name=
"abstract_output"
type=
"text"
indexed=
"false"
stored=
"true"
/>
...
...
@@ -277,7 +277,7 @@
<copyField
source=
"series"
dest=
"text"
/>
<copyField
source=
"series_index"
dest=
"text"
/>
<copyField
source=
"author"
dest=
"text"
/>
<copyField
source=
"
subject
"
dest=
"text"
/>
<copyField
source=
"
tag
"
dest=
"text"
/>
<copyField
source=
"publisher"
dest=
"text"
/>
<copyField
source=
"identifier"
dest=
"text"
/>
<copyField
source=
"filetype"
dest=
"text"
/>
...
...
website/index.html
View file @
54e0298a
...
...
@@ -40,9 +40,9 @@
Kennungen
:
<
ul
>
{{{
identifiers
}}}
<
/ul
>
<
/div
>
<
div
class
=
"
book
subject
s
"
>
<
div
class
=
"
book
tag
s
"
>
Schlagwörter
:
<
ul
>
{{{
subject
s
}}}
<
/ul
>
<
ul
>
{{{
tag
s
}}}
<
/ul
>
<
/div
>
<
div
class
=
"
bookpublisher
"
>
Herausgeber
:
...
...
@@ -87,7 +87,7 @@
});
function
get_ebooks
(
start_pos
)
{
if
(
query
)
{
if
(
query
)
{
$
(
'
#status
'
).
removeClass
(
'
error
'
).
text
(
'
Suche läuft...
'
);
$
.
getJSON
(
solr_url_prefix
+
'
/?q=
'
+
encodeURIComponent
(
query
)
+
'
&wt=json&rows=
'
+
query_limit
+
'
&start=
'
+
start_pos
,
function
(
data
)
{
if
(
data
[
'
responseHeader
'
][
'
status
'
]
!=
0
)
{
...
...
@@ -110,6 +110,7 @@
}
var
template
=
$
(
'
#template-bookitem
'
).
html
();
// load template
$
.
each
(
data
[
'
response
'
][
'
docs
'
],
function
(
key
,
val
)
{
// fill template for each book
// Book URL
var
bookurl
=
calibre_url_prefix
+
'
/
'
+
val
[
'
path
'
]
+
'
/
'
+
val
[
'
filename
'
]
...
...
@@ -128,33 +129,32 @@
// Book Author
var
bookauthors
=
''
;
if
(
val
[
'
author
'
])
{
for
(
let
i
of
val
[
'
author
'
])
{
bookauthors
+=
'
<li>
'
+
htmlEncode
(
i
)
+
'
</li>
'
;
for
(
var
i
=
0
;
i
<
val
[
'
author
'
]
.
length
;
i
++
)
{
bookauthors
+=
'
<li>
'
+
htmlEncode
(
val
[
'
author
'
][
i
]
)
+
'
</li>
'
;
}
}
// Book
Subject
s
var
book
subject
s
=
''
;
if
(
val
[
'
subject
'
])
{
for
(
let
i
of
val
[
'
subject
'
]
)
{
book
subject
s
+=
'
<li>
'
+
htmlEncode
(
i
)
+
'
</li>
'
;
// Book
Tag
s
var
book
tag
s
=
''
;
if
(
val
[
'
tag
'
])
{
for
(
var
i
=
0
;
i
<
val
[
'
tag
'
].
length
;
i
++
)
{
book
tag
s
+=
'
<li>
'
+
htmlEncode
(
val
[
'
tag
'
][
i
]
)
+
'
</li>
'
;
}
}
// Book Identifiers
var
bookidentifiers
=
''
;
if
(
val
[
'
identifier
'
])
{
for
(
let
i
of
val
[
'
identifier
'
])
{
if
(
i
.
substr
(
0
,
5
)
==
'
uuid:
'
)
{
continue
;
}
// skip calibre uuid
bookidentifiers
+=
'
<li>
'
+
htmlEncode
(
i
)
+
'
</li>
'
;
for
(
var
i
=
0
;
i
<
val
[
'
identifier
'
]
.
length
;
i
++
)
{
if
(
val
[
'
identifier
'
][
i
]
.
substr
(
0
,
5
)
==
'
uuid:
'
)
{
continue
;
}
// skip calibre uuid
bookidentifiers
+=
'
<li>
'
+
htmlEncode
(
val
[
'
identifier
'
][
i
]
)
+
'
</li>
'
;
}
}
// Book Languages
var
booklanguages
=
''
;
if
(
val
[
'
language
'
])
{
for
(
let
i
of
val
[
'
language
'
])
{
booklanguages
+=
'
<li>
'
+
htmlEncode
(
i
)
+
'
</li>
'
;
for
(
var
i
=
0
;
i
<
val
[
'
language
'
]
.
length
;
i
++
)
{
booklanguages
+=
'
<li>
'
+
htmlEncode
(
val
[
'
language
'
][
i
]
)
+
'
</li>
'
;
}
}
...
...
@@ -187,7 +187,7 @@
coverurl
:
coverurl
,
title
:
booktitle
,
authors
:
bookauthors
,
subjects
:
booksubject
s
,
tags
:
booktag
s
,
identifiers
:
bookidentifiers
,
series
:
bookseries
,
date
:
bookdate
,
...
...
@@ -198,12 +198,13 @@
var
bookdetails
=
Mustache
.
render
(
template
,
bookdata
);
// fill template with values
$
(
'
#booklist
'
).
append
(
bookdetails
).
children
(
'
:last
'
).
hide
().
fadeIn
(
1000
);
// append book to booklist
scroll_load_finished
=
true
;
});
}
}).
fail
(
function
()
{
$
(
'
#status
'
).
addClass
(
'
error
'
).
text
(
'
Fehler
'
);
});
scroll_load_finished
=
true
;
}
}
...
...
@@ -260,7 +261,7 @@
});
// search button
$
(
'
#searchform
'
).
submit
(
function
(
e
v
)
{
$
(
'
#searchform
'
).
on
(
"
submit
"
,
function
(
e
)
{
query
=
$
(
'
input#solr_query
'
).
val
();
get_ebooks
(
start_pos
=
0
);
return
false
;
...
...
@@ -314,7 +315,7 @@
</script>
<div
id=
"searchcontainer"
>
<form
id=
"searchform"
method=
"post"
>
<form
id=
"searchform"
>
<div
id=
"querybar"
>
<div
id=
"querystring"
>
<label
for=
"solr_query"
>
SOLR Query
</label>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment