Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
ls.ext
Commits
ef2f67fd
Commit
ef2f67fd
authored
May 15, 2018
by
Petter Goksøyr Åsen
Committed by
Magnus Westergaard
Sep 10, 2018
Browse files
WIP integrate sibyl
Deprecate koha-indexer
parent
6302a6b1
Changes
7
Hide whitespace changes
Inline
Side-by-side
docker-compose/common.yml
View file @
ef2f67fd
...
...
@@ -108,14 +108,24 @@ services:
MYSQL_PASSWORD
:
"
${KOHA_ADMINPASS:-secret}"
MYSQL_ROOT_PASSWORD
:
"
${KOHA_ADMINPASS:-secret}"
MYSQL_USER
:
"
${KOHA_ADMINUSER:-admin}"
SIBYL_USER
:
"
${SIBYL_USER:-admin}"
SIBYL_PASSWORD
:
"
${SIBYL_PASSWORD:-admin}"
volumes
:
-
"
koha_mysql_data:/var/lib/mysql"
#- ./setup_sibyl.sql:/docker-entrypoint-initdb.d/setup_sibyl.sql
logging
:
driver
:
"
json-file"
options
:
max-size
:
"
1m"
max-file
:
"
2"
sibyl
:
depends_on
:
-
koha_mysql
image
:
alpine
command
:
-
"
sh
-c
'sleep
100"
catalinker
:
container_name
:
catalinker
image
:
"
digibib/redef-catalinker:${GITREF}"
...
...
@@ -150,6 +160,7 @@ services:
KOHA_API_PASS
:
"
${KOHA_API_PASS:-secret}"
GITREF
:
"
${GITREF:-0}"
BUILD_TAG
:
"
${BUILD_TAG:-0}"
ELASTICSEARCH_URL
:
"
sibyl:1666"
logging
:
driver
:
"
json-file"
options
:
...
...
@@ -264,27 +275,27 @@ services:
max-size
:
"
1m"
max-file
:
"
2"
koha_indexer
:
container_name
:
koha_indexer
image
:
"
digibib/koha-indexer:8fe76d382ea8333a7392a7c6f22ae181da28fd99"
networks
:
-
backend
command
:
-
"
/koha-indexer"
-
"
-db=/var/lib/state/koharecords.db"
-
"
-sparql=http://fuseki:3030/ds/update"
-
"
-freq=15m"
-
"
-update"
-
"
-initial-import"
-
"
-services=http://services:8005/search/publication/reindex"
environment
:
KOHA_ADMINPASS
:
"
${KOHA_ADMINPASS:-secret}"
KOHA_ADMINUSER
:
"
${KOHA_ADMINUSER:-admin}"
KOHA_INSTANCE
:
"
${KOHA_INSTANCE:-name}"
volumes
:
-
"
koha_state:/var/lib/state"
logging
:
driver
:
"
json-file"
options
:
max-size
:
"
1m"
max-file
:
"
2"
#
koha_indexer:
#
container_name: koha_indexer
#
image: "digibib/koha-indexer:8fe76d382ea8333a7392a7c6f22ae181da28fd99"
#
networks:
#
- backend
#
command:
#
- "/koha-indexer"
#
- "-db=/var/lib/state/koharecords.db"
#
- "-sparql=http://fuseki:3030/ds/update"
#
- "-freq=15m"
#
- "-update"
#
- "-initial-import"
#
- "-services=http://services:8005/search/publication/reindex"
#
environment:
#
KOHA_ADMINPASS: "${KOHA_ADMINPASS:-secret}"
#
KOHA_ADMINUSER: "${KOHA_ADMINUSER:-admin}"
#
KOHA_INSTANCE: "${KOHA_INSTANCE:-name}"
#
volumes:
#
- "koha_state:/var/lib/state"
#
logging:
#
driver: "json-file"
#
options:
#
max-size: "1m"
#
max-file: "2"
docker-compose/dev.yml
View file @
ef2f67fd
...
...
@@ -29,6 +29,8 @@ services:
ports
:
-
"
8005:8005"
-
"
5070:5070"
extra_hosts
:
-
"
sibyl:10.172.3.100"
environment
:
KOHA_MYSQL_USER
:
"
${KOHA_ADMINUSER:-admin}"
KOHA_MYSQL_PASS
:
"
${KOHA_ADMINPASS:-secret}"
...
...
@@ -42,6 +44,8 @@ services:
volumes
:
-
"
${MOUNTPATH:-..}/redef/patron-client/src:/usr/src/app/src"
-
"
${MOUNTPATH:-..}/redef/patron-client/test:/usr/src/app/test"
extra_hosts
:
-
"
sibyl:10.172.3.100"
ports
:
-
"
8000:8000"
-
"
35729:35729"
...
...
@@ -132,6 +136,6 @@ services:
-
"
-c"
-
"
mkfifo
pipe;
while
true
;
do
{
read
line<pipe;echo
-e
'HTTP/1.1
200
OK
\\
r
\\
n'
;
}
|
nc
-l
-p
9999
>
pipe;
done"
koha_indexer
:
ports
:
-
"
8009:8009"
#
koha_indexer:
#
ports:
#
- "8009:8009"
docker-compose/setup_sibyl.sql
0 → 100644
View file @
ef2f67fd
CREATE
DATABASE
IF
NOT
EXISTS
sibyl
;
GRANT
ALL
ON
sibyl
.
*
TO
'$SIBYL_USER'
@
'%'
IDENTIFIED
BY
'$SIBYL_PASSWORD'
;
redef/patron-client/src/backend/routes/search.js
View file @
ef2f67fd
...
...
@@ -35,7 +35,7 @@ module.exports = (app) => {
app
.
get
(
'
/q
'
,
(
request
,
response
)
=>
{
const
queryString
=
request
.
originalUrl
.
substr
(
request
.
originalUrl
.
indexOf
(
'
?
'
)
+
1
)
fetch
(
'
http://
elasticsearch:9200
/search/work/_search
'
,
{
fetch
(
'
http://
sibyl:1666
/search/work/_search
'
,
{
method
:
'
POST
'
,
body
:
JSON
.
stringify
(
searchBuilder
.
buildQuery
(
queryString
),
null
,
2
)
}).
then
(
res
=>
{
...
...
redef/services/src/main/java/no/deichman/services/App.java
View file @
ef2f67fd
...
...
@@ -36,7 +36,7 @@ public final class App {
private
Server
jettyServer
;
private
String
kohaPort
;
private
boolean
inMemoryRDFRepository
;
private
String
elasticSearchUrl
=
System
.
getProperty
(
"ELASTICSEARCH_URL"
,
"http://
elasticsearch:9200
"
);
private
String
elasticSearchUrl
=
System
.
getProperty
(
"ELASTICSEARCH_URL"
,
"http://
sibyl:1666
"
);
private
String
z3950Endpoint
;
public
App
(
int
port
,
String
kohaPort
,
boolean
inMemoryRDFRepository
,
String
z3950Endpoint
)
{
...
...
redef/services/src/main/java/no/deichman/services/entity/ResourceBase.java
View file @
ef2f67fd
...
...
@@ -37,7 +37,7 @@ public abstract class ResourceBase {
}
private
String
elasticSearchBaseUrl
()
{
return
Optional
.
ofNullable
(
getConfig
()
!=
null
?
getConfig
().
getInitParameter
(
ELASTIC_SEARCH_URL
)
:
null
).
orElse
(
"http://
elasticsearch:9200
"
);
return
Optional
.
ofNullable
(
getConfig
()
!=
null
?
getConfig
().
getInitParameter
(
ELASTIC_SEARCH_URL
)
:
null
).
orElse
(
"http://
sibyl:1666
"
);
}
private
static
InMemoryRepository
staticInMemoryRepository
;
...
...
redef/services/src/main/java/no/deichman/services/search/ModelToIndexMapper.java
View file @
ef2f67fd
...
...
@@ -27,7 +27,7 @@ import java.util.Map;
*/
public
class
ModelToIndexMapper
{
private
static
final
String
AGENT
=
"Agent"
;
public
static
final
Gson
GSON
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
public
static
final
Gson
GSON
=
new
GsonBuilder
().
create
();
private
String
query
;
private
Map
<
String
,
Object
>
context
;
private
String
type
;
...
...
Write
Preview
Markdown
is supported
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