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

Problem with put displayname field to elastic index on Arches 7.5.3 #11090

Open
cube13 opened this issue Jun 26, 2024 · 0 comments
Open

Problem with put displayname field to elastic index on Arches 7.5.3 #11090

cube13 opened this issue Jun 26, 2024 · 0 comments
Labels
API Subject: Search Type: Bug Something isn't working

Comments

@cube13
Copy link

cube13 commented Jun 26, 2024

Problem Description:

I use Arches 7.5.3
I use this request to create an object

curl -X PUT "https://arches.example.gov/resources/h0001/OBJECT_ID" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-d '{
      "@id": "http://localhost:8000/resources/OBJECT_ID",
      "@type": "https://example.gov/ontologies/heritage/ImmovableHeritageObject",
      "http://heritage.example/ontology/hed/R1i_has_projection": [
        {
          "http://www.cidoc-crm.org/cidoc-crm/P1_is_identified_by": [
            {
              "@id": "http://localhost:8000/tile/4e68887b3d6-d5ce-4462-b6b3-8117049c6e64/node/f9ab11cd-2ebd-11ee-9f50-b19f423426e4",
              "@type": "https://example.gov/ontologies/heritage/ObjectAppellation",
              "https://example.gov/ontologies/heritage/has_value": {
                "@language": "uk",
                "@value": "Created object for test"
              }
            }
          ]
        }
      ],
      "http://heritage.example/ontology/hed/R102_has_guid": "095aefe2-1dcf-440b-8b6a-931a28530a96"
    }'

After successfully creating the object, I search for the object by model and name in Arches Elastic Search

curl -X GET "http://elastic_url:9200/arches_resources/_search?pretty=true" \
-H "Content-Type: application/json" \
-d '{
   "query": {
     "nested": {
       "path": "strings",
       "query": {
         "bool": {
           "must": [
             {
               "match": {
                 "strings.string": {
                   "query": "Created object for test",
                   "operator": "and"
                 }
               }
             }
           ]
         }
       },
       "inner_hits": {}
     }
   }
 }'

I get a response from Elastic that it finds my object with the name 'Created object for test' but the displayname field is empty

{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 42.55066,
    "hits" : [
      {
        "_index" : "arches_resources",
        "_id" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
        "_score" : 42.55066,
        "_source" : {
          "date_ranges" : [ ],
          "dates" : [ ],
          "displaydescription" : [ ],
          **"displayname" : [ ],**
          "domains" : [ ],
          "geometries" : [ ],
          "graph_id" : "6460104f-6027-420e-8854-eac1d8b4a5bf",
          "ids" : [ ],
          "legacyid" : null,
          "map_popup" : [ ],
          "numbers" : [ ],
          "permissions" : {
            "users_with_no_access" : [ ],
            "users_without_delete_perm" : [ ],
            "users_without_edit_perm" : [ ],
            "users_without_read_perm" : [ ]
          },
          "points" : [ ],
          "provisional_resource" : "false",
          "resourceinstanceid" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
          "root_ontology_class" : "https://example.gov/ontologies/heritage/ImmovableHeritageObject",
          "strings" : [
            {
              "language" : "uk",
              "nodegroup_id" : "d64e8bda-3fe0-11ee-96b2-77bdb42acc90",
              "provisional" : false,
              "string" : "095aefe2-1dcf-440b-8b6a-931a28530a96"
            },
            {
              "language" : "uk",
              "nodegroup_id" : "f9ab11cd-2ebd-11ee-9f50-b19f423426e4",
              "provisional" : false,
              "string" : "Created object for test"
            }
          ],
          "tiles" : [
            {
              "data" : {
                "d64e8bda-3fe0-11ee-96b2-77bdb42acc90" : {
                  "uk" : {
                    "direction" : "ltr",
                    "value" : "095aefe2-1dcf-440b-8b6a-931a28530a96"
                  }
                }
              },
              "nodegroup_id" : "d64e8bda-3fe0-11ee-96b2-77bdb42acc90",
              "parenttile_id" : null,
              "provisionaledits" : null,
              "resourceinstance_id" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
              "sortorder" : 0,
              "tileid" : "f4a8ac12-aa4a-45ed-8da1-ff96051cba1b"
            },
            {
              "data" : { },
              "nodegroup_id" : "574be64a-2ebd-11ee-9f50-b19f423426e4",
              "parenttile_id" : null,
              "provisionaledits" : null,
              "resourceinstance_id" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
              "sortorder" : 0,
              "tileid" : "4ea60370-e3f7-467a-9049-3472f0112946"
            },
            {
              "data" : {
                "f9ab11cf-2ebd-11ee-9f50-b19f423426e4" : {
                  "uk" : {
                    "direction" : "ltr",
                    "value" : "Created object for test"
                  }
                }
              },
              "nodegroup_id" : "f9ab11cd-2ebd-11ee-9f50-b19f423426e4",
              "parenttile_id" : "4ea60370-e3f7-467a-9049-3472f0112946",
              "provisionaledits" : null,
              "resourceinstance_id" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
              "sortorder" : 0,
              "tileid" : "803f7363-90ef-4640-ac50-7c43b5234a4f"
            }
          ]
        },
        "inner_hits" : {
          "strings" : {
            "hits" : {
              "total" : {
                "value" : 1,
                "relation" : "eq"
              },
              "max_score" : 42.55066,
              "hits" : [
                {
                  "_index" : "arches_resources",
                  "_id" : "095aefe2-1dcf-440b-8b6a-931a28530a96",
                  "_nested" : {
                    "field" : "strings",
                    "offset" : 1
                  },
                  "_score" : 42.55066,
                  "_source" : {
                    "language" : "uk",
                    "nodegroup_id" : "f9ab11cd-2ebd-11ee-9f50-b19f423426e4",
                    "provisional" : false,
                    "string" : "Created object for test"
                  }
                }
              ]
            }
          }
        }
      }
    ]
  }
}

If I reindex Elastic using the command python manage.py es reindex_database, the object's name appears in the field.

@chiatt chiatt added Type: Bug Something isn't working Subject: Search API labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Subject: Search Type: Bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants