jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.5k stars 4.02k forks source link

Elasticsearch doesn't work for relationship after insert, the same work after update #18555

Closed antsch01 closed 8 months ago

antsch01 commented 2 years ago
Overview of the issue

The search doesn't work after inserting a new entity, the same search work after updating the entity. it seems after the updating entity the indexing has been updated.

Motivation for or Use Case

The client is not able to find the entity after inserting

Reproduce the error
  1. Log into backoffice
  2. Create the entity B with reference to A with id 100
  3. Save is ok
  4. Try to search 100, no found result --> search doesn't work
  5. Open entity B, update and save
  6. Try to search 100 and found 1 result, --> search work
Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.seaviaggiare.app",
      "nativeLanguage": "it"
    },
    "jhipsterVersion": "6.10.5",
    "applicationType": "monolith",
    "baseName": "seaviaggiare",
    "packageName": "com.seaviaggiare.app",
    "packageFolder": "com/seaviaggiare/app",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1633264908943,
    "testFrameworks": ["cucumber"],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "it",
    "languages": ["it", "en"],
    "blueprints": []
  }
}

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
mraible commented 2 years ago

It looks like you're using JHipster 6.10.5. Can you try re-generating your app with JHipster 7.8.1 and see if this problem still exists?

antsch01 commented 2 years ago

It looks like you're using JHipster 6.10.5. Can you try re-generating your app with JHipster 7.8.1 and see if this problem still exists?

Hi @mraible

thank you for reply, I tried to update jhister and regenerate the project following the guide https://www.jhipster.tech/upgrading-an-application/#automatic_upgrade but got an error. I executed the command: npx jhipster upgrade and got the error Cannot read property 'propertyName' of undefined

image

Could you help me?

Thanks, Antonio

Tcharl commented 2 years ago

Hi Antonio,

Regarding your upgrade issue, it looks like a misconfiguration of your jdl or your entities ./jhipster/*.json (missing the name of your opposite relationship?). Can you please try to update or post them so that I would be able to help?

Thanks!

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days