Данные эластичного поиска пружин - PullRequest
0 голосов
/ 27 августа 2018

Я новичок в работе с сопоставлениями Elasticsearch, я создал свой класс Bordereau с аннотацией внутри класса и файлом json, который содержит сопоставление.

@Document(indexName = "#{@profilePrefixe}_bordereau", type = "Bordereau")
@Mapping(mappingPath = "/mapping/bordereau-mapping.json")
public class BordereauOe {
    @Id
    private String idBordereau;
    @Field(type= FieldType.Keyword)
    private String numBordereau;
    private String idCreateur;
    private int existe;
    private String dateCreation;
    private Long dateCreationMiliseconde;
    private int nbrDossier;
    private int nbrDossierTraiter;
    private boolean statut;
    private boolean statutSaturatoin;
    private String bordereauFile;
    @Field(type= FieldType.Keyword)
    private String nomClient;
    private int nbrDossierAffecter;
    private String cabinet;
    @Field(type= FieldType.Keyword)
    private String compagnie;
    private int nbrDossierAjoutes;

со следующим файлом сопоставления: bordereau-mapping.json

{

  "Bordereau" : {
    "properties" : {
      "accusedFiles" : {
        "type" : "text"
      },
      "bordereauFile" : {
        "type" : "text"
      },
      "cabinet" : {
        "type" : "keyword"
      },
      "compagnie" : {
        "type" : "keyword"
      },
      "dateCreation" : {
        "type" : "date",
        "format" : "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"
      },
      "dateCreationMiliseconde" : {
        "type" : "long"
      },
      "existe" : {
        "type" : "long"
      },
      "idBordereau" : {
        "type" : "text"
      },
      "idCreateur" : {
        "type" : "text"
      },
      "nbrDossier" : {
        "type" : "long"
      },
      "nbrDossierAffecter" : {
        "type" : "long"
      },
      "nbrDossierAjoutes" : {
        "type" : "long"
      },
      "nbrDossierTraiter" : {
        "type" : "long"
      },
      "nomClient" : {
        "type" : "keyword"
      },
      "numBordereau" : {
        "type" : "keyword"
      },
      "statut" : {
        "type" : "boolean"
      },
      "statutSaturatoin" : {
        "type" : "boolean"
      }
    }
  }

}

Этот проект (все еще) работает нормально. но через день он выбрасывает текущие исключения

[ОШИБКА] 2018-08-24 08: 31: 24.859 [http-nio-8080-exec-4] AcquisitionLogs: 56 - ******* Исключение: org.springframework.data.mapping.context. InvalidPersistentPropertyPath: не найдено свойство dateCreation в классе ma.accolade.ged.ms.gestion.acquisition.persistance.oe.BordereauOe! Вы имели в виду dateCreation?
[ОШИБКА] 2018-08-24 09: 35: 04.429 [http-nio-8080-exec-9] AcquisitionLogs: 56 - ******* Исключение: org.springframework.data.mapping.context.InvalidPersistentPropertyPath: Нет свойство 'idUser' найдено в классе ma.accolade.ged.ms.gestion.acquisition.persistance.oe.PreferenceAffichageOe! Вы имели в виду idUser?
[ОШИБКА] 2018-08-24 09: 36: 04.537 [http-nio-8080-exec-6] AcquisitionLogs: 56 - ******* Исключение: org.springframework.data.mapping.context.InvalidPersistentPropertyPath: Нет свойство 'id' найдено в классе ma.accolade.ged.ms.gestion.acquisition.persistance.oe.DocumentOe! Вы имели в виду id:

Еще раз спасибо за вашу помощь.

1 Ответ

0 голосов
/ 27 августа 2018

У вас неправильные определения типов в сопоставлении классов и сопоставлений. например:

public class BordereauOe {
   private String dateCreation;
}

and in mapping, you have it defined as Date

"dateCreation" : {
    "type" : "date",
    "format" : "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"
  }

Пожалуйста, просмотрите все определения полей между классом и отображением и убедитесь, что они совпадают

...