0

In the Field Annotation the indexAnalyzer not found, Is this any version problem.

Error:- The attribute indexAnalyzer is undefined for the annotation type Field

My Gradle:-

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile group: 'commons-validator', name: 'commons-validator', version: '1.6'
    //compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '1.2.5.RELEASE'
    //compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '1.5.6.RELEASE'
    compile('org.springframework.boot:spring-boot-starter-data-elasticsearch:1.3.2.RELEASE')
    compile group: 'net.java.dev.jna', name: 'platform', version: '3.5.0'
    testCompile('org.springframework.boot:spring-boot-starter-test')
}
Deepesh Uniyal
  • 923
  • 3
  • 20
  • 44
  • 2
    indexAnalyzer has been removed in 2.0, analyzer is the one you should be using. https://www.elastic.co/guide/en/elasticsearch/reference/2.0/breaking_20_mapping_changes.html#_analyzer_mappings – Val Aug 24 '17 at 03:21
  • Ok, so how can I define my custom analyzer. @Field(type = FieldType.String, index = FieldIndex.analyzed, analyzer = "autocomplete") the above one is showing the error at build time, the error is :- Caused by: MapperParsingException[analyzer [autocomplete] not found for field [contentTitle]] – Deepesh Uniyal Aug 24 '17 at 05:35
  • That's something you need to set up when you [create your index](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html). – Val Aug 24 '17 at 05:47
  • Hi, Yes, I have @Setting(settingPath = "/home/deepeshk/Desktop/Learning_Project/LMS-BackEnd/kp-lms-microservices/elastic-services/build/libs/elasticsearch-settings.json") and json file also available, but its not working , can you pls give me some example. – Deepesh Uniyal Aug 24 '17 at 07:07
  • 1
    This answer might help: https://stackoverflow.com/questions/31992274/spring-data-elasticsearch-settings-spring-cant-find-config-file/32001695#32001695 – Val Aug 24 '17 at 07:19
  • haaaaa, Finally its working, thanks a lot, Don't why its working only indexName = "test", if I will change name of index it will show the error at build time. – Deepesh Uniyal Aug 24 '17 at 07:33

0 Answers0