Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.springframework.batch.core.Job
import org.springframework.batch.core.Step
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing
import org.springframework.batch.core.job.builder.JobBuilder
import org.springframework.batch.core.launch.support.RunIdIncrementer
import org.springframework.batch.core.repository.JobRepository
import org.springframework.batch.core.step.builder.StepBuilder
import org.springframework.beans.factory.annotation.Value
Expand All @@ -30,6 +31,7 @@ class MapBatchConfig(
): Job {
return JobBuilder(jobName, jobRepository)
.start(mapStep)
.incrementer(RunIdIncrementer()) // 🔥 이 라인 추가
.build()

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import jakarta.persistence.Id
import org.springframework.data.elasticsearch.annotations.Document
import org.springframework.data.elasticsearch.annotations.Field
import org.springframework.data.elasticsearch.annotations.FieldType
import org.springframework.data.elasticsearch.annotations.Mapping
import org.springframework.data.elasticsearch.annotations.Setting
import java.time.LocalDateTime
import java.util.*

@Document(indexName = "locations")
@Setting(settingPath = "elasticsearch/settings/setting.json")
@Mapping(mappingPath = "elasticsearch/mappings/mapping.json")
data class LocationDocument(

@Id
val id: UUID,
@Field(type = FieldType.Text)
@Field(type = FieldType.Text, analyzer = "korean")
val name: String,
@Field(type = FieldType.Keyword)
val category: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ElasticsearchConfig {
val credentialsProvider = BasicCredentialsProvider()
credentialsProvider.setCredentials(
AuthScope.ANY,
UsernamePasswordCredentials("elastic", "61tkSdZs6lUk2Mfa+nq5")
UsernamePasswordCredentials("elastic", "test1234")
)

val sslContext = SSLContexts.custom()
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/elasticsearch/mappings/mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"properties": {
"name": {
"type": "text",
"analyzer": "korean"
}
}
}
22 changes: 22 additions & 0 deletions src/main/resources/elasticsearch/settings/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"analysis": {
"tokenizer": {
"nori_none": {
"type": "nori_tokenizer",
"decompound_mode": "none"
},
"nori_discard": {
"type": "nori_tokenizer",
"decompound_mode": "discard"
},
"nori_mixed": {
"type": "nori_tokenizer",
"decompound_mode": "mixed"
}
},
"analyzer": {
"korean": {
"type": "nori"}
}
}
}