Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Goethes Farbenlehre
gfl-app-new
Commits
903c0141
Commit
903c0141
authored
Dec 07, 2021
by
asajedi
Browse files
Merge branch 'excludeSampleTEIDocumentFromIndexing' into 'master'
Exclude sample TEI document from indexing See merge request
!59
parents
41cb6479
02032ed7
Pipeline
#255752
failed with stages
in 6 minutes and 49 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/Command/SolrIndexing.php
View file @
903c0141
...
...
@@ -7,11 +7,13 @@ namespace App\Command;
use
App\Import\ImporterInterface
;
use
App\Index\IndexerInterface
;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Input\InputArgument
;
use
Symfony\Component\Console\Input\InputInterface
;
use
Symfony\Component\Console\Output\OutputInterface
;
class
SolrIndexing
extends
Command
{
protected
static
string
$description
=
'Process TEI data to solr data for importing into solr.'
;
protected
static
$defaultName
=
'app:start_indexing'
;
private
ImporterInterface
$importer
;
private
IndexerInterface
$indexer
;
...
...
@@ -28,7 +30,9 @@ class SolrIndexing extends Command
*/
protected
function
configure
()
{
$this
->
setDescription
(
'Process TEI data to solr data for importing into solr.'
);
$this
->
setDescription
(
self
::
$description
)
->
addArgument
(
'server'
,
InputArgument
::
REQUIRED
,
'Server Type'
);;
}
/**
...
...
@@ -36,12 +40,11 @@ class SolrIndexing extends Command
*/
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
):
int
{
$server
=
$input
->
getArgument
(
'server'
);
$output
->
writeln
(
'Start solr indexing.'
);
$this
->
importer
->
import
();
$this
->
importer
->
import
(
$server
);
$this
->
indexer
->
deleteSolrIndex
();
$this
->
indexer
->
tei2solr
();
$time
=
microtime
(
true
)
-
$_SERVER
[
'REQUEST_TIME_FLOAT'
];
$time
/=
60
;
$output
->
writeln
(
'Indexing process completed in '
.
$time
.
' minutes.'
);
...
...
src/Import/Importer.php
View file @
903c0141
...
...
@@ -85,9 +85,12 @@ class Importer implements ImporterInterface
}
}
public
function
import
():
void
public
function
import
(
string
$server
):
void
{
$this
->
importSampleTeiDocument
();
if
(
'dev'
===
$server
)
{
$this
->
importSampleTeiDocument
();
}
$filesystem
=
new
Filesystem
();
if
(
!
$filesystem
->
exists
(
$this
->
teiDir
))
{
$filesystem
->
mkdir
(
$this
->
teiDir
);
...
...
src/Import/ImporterInterface.php
View file @
903c0141
...
...
@@ -4,5 +4,5 @@ namespace App\Import;
interface
ImporterInterface
{
public
function
import
():
void
;
public
function
import
(
string
$server
):
void
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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