Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for more abstraction #17

Closed
MyNameIsAndrew-Mangix opened this issue May 15, 2024 · 2 comments
Closed

Refactor for more abstraction #17

MyNameIsAndrew-Mangix opened this issue May 15, 2024 · 2 comments

Comments

@MyNameIsAndrew-Mangix
Copy link
Contributor

The data returned from the search API should be something like this:

[
    {
        "collection": "person",
        "_id": "8645acbb85u1094",
        "firstName": "sam",
        "lastName": "smith",
        "email": "foo@bar.com"
    },
    {
        "collection": "partner",
        "_id": "OID VALUE"
        "name": "The Best Partner"
        "contacts": ["oid", "oid", "oid"]
    },
    {
        "collection": "topic",
        "_id": "OID VALUE"
        "name": "Some Topic",
        "skills": ["skill-name-1", "skill-name-2"]
    }
]
@FlatBallFlyer
Copy link
Contributor

Can we please research the elastic mongodb connector. I'm hoping we can do this in the compose file:

  • Start the elastic container first
  • Run an elastic initialization script then
  • Start the mongodb container then
  • Start a mongodb to elastic connector container then
  • Run the mongodb initialization script then
  • Start all the other services.

@FlatBallFlyer
Copy link
Contributor

FlatBallFlyer commented Jul 22, 2024

and I think the data structure in the index should look something like this - this allows us to search on a collection name as well as everything else. Of course this is highly dependent on the connector.

[
  {
    "_id": "elastic_id_value",
    "collection": "collection name",
    "collection_id": "collection unique ID value",
    "object": {
      "_id": "mongo_id value (same as ../collection_id)",
      "other": "all the other properties of the document"
    }
  },
  {
    "_id": "ACAC00000000000000000001",
    "collection": "Person",
    "collection_id": "AAAA00000000000000000000",
    "object": {
        "_id": "AAAA00000000000000000001",
      "userName": "JamesSmith",
      "firstName": "James",
      "lastName": "Smith",
      "status": "Pending",
      "roles": ["Member"],
      "mentorId": "AAAA00000000000000000005",
      "partnerId": "bbbb00000000000000000007",
      "title": "Apprentice",
      "cadence": "Daily",
      "eMail": "JamesSmith@fakemail.com",
      "gitHub": "JamesSmith",
      "device": "Mac (Intel)",
      "location": "GVL SC",
      "phone": "449-882-6722",
      "description": "She was too busy always talking about what she wanted to do to actually do any of it.",
      "lastSaved": {
        "atTime": "2/27/2024 18:17:58",
        "byUser": AAAA00000000000000000001,
        "fromIp": "192.168.1.3",
        "correlationId": "ae078031-7de2-4519-bcbe-fbd5e72b69d3"
      }
    }
  },
  {
    "_id": "ACAC00000000000000000002",
    "collection": "Topic",
    "collection_id": "BBBB00000000000000000002",
    "object": {
      "_id": "BBBB00000000000000000002",
      "name": "History of Computing",
      "status": "Active",
      "description": "With this topic you'll learn about the history of computing and some of the most important events that shaped the Information Age.",
      "category": "Foundations of ITSM",
      "resources": ["CCCC00000000000000000002", "CCCC00000000000000000003", "CCCC00000000000000000004", "CCCC00000000000000000005", "CCCC00000000000000000006", "CCCC00000000000000000007",   "CCCC00000000000000000008"],
      "skills": "BBBB00000000000000000003", "BBBB00000000000000000004", "BBBB00000000000000000005"],
      "lastSaved": {
        "atTime": "4/3/2024 18:17:58",
        "byUser": "AAAA000000000000000000001",
        "fromIp": "192.168.1.39",
        "correlationId": "ae078031-7de2-4519-bcbe-fbd5e72b69d3"
      }
    }
  }  
] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants