tripal / tripal_elasticsearch

GNU General Public License v3.0
5 stars 8 forks source link

Entities Indexing error #274

Open erikattechslice opened 3 years ago

erikattechslice commented 3 years ago

https://github.com/erikattechslice/tripal_elasticsearch I have a fork and trying to get the module to work with ES7. Getting the below error for entities index:

site http://default] [TRIPAL ERROR] [TRIPAL_ELASTICSEARCH] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [entity_id] cannot be changed from type [integer] to [long]"}],"type":"illegal_argument_exception","reason":"mapper [entity_id] cannot be changed from type [integer] to [long]"},"status":400}

also seeing this warn spam from the cron:

Invalid argument supplied for foreach() file_entity.file.inc:248 [warning] Invalid argument supplied for foreach() file_entity.file.inc:248 [warning] Invalid argument supplied for foreach() file_entity.file.inc:248 [warning] Invalid argument supplied for foreach() file_entity.file.inc:248 [warning] Invalid argument supplied for foreach() file_entity.file.inc:248 [warning] Invalid argument supplied for foreach() file_entity.file.inc:248

i tried to force tine entity_id to an int on line 175 of EntiitesIndexJob.php with :+1: $all[] = (object) [ 'entity_id' => (int)($entity->id), 'title' => $title, 'bundle_label' => $record->bundle_label, 'content' => $content, ];

any thoughts? Thanks for the help

almasaeed2010 commented 3 years ago

it sounds like you have to delete the index and start over. Did you give that a try?

erikattechslice commented 3 years ago

I have tried that but it start throwing the 'Invalid argument supplied for foreach() file_entity.file.inc:248 [warning]' then in the ES logs i see the same type of error.

also seeing 2020-12-08T19:59:14,864][INFO ][o.e.a.b.TransportShardBulkAction] [usda-nal-i5k.ttl.im] [website][0] mapping update rejected by primary java.lang.IllegalArgumentException: mapper [nid] cannot be changed from type [integer] to [long] at org.elasticsearch.index.mapper.ParametrizedFieldMapper.merge(ParametrizedFieldMapper.java:94) ~[elasticsearch-7.10.0.jar:7.10.0] at org.elasticsearch.index.mapper.ParametrizedFieldMapper.merge(ParametrizedFieldMapper.java:61) ~[elasticsearch-7.10.0.jar:7.10.0] at org.elasticsearch.index.mapper.ObjectMapper.doMerge(ObjectMapper.java:535) ~[elasticsearch-7.10.0.jar:7.10.0]

Is there a section of the code where its making the bulk index requests where we can force the *_id to be the integer type we want?

almasaeed2010 commented 3 years ago

@erikattechslice I managed to test your code to index a small tripal site using Elasticsearch 7.

It's likely that the code we use to bulk index entities/pages is not supported by ES7. I'd go through the elasticsearch-php documentation to see if there is anything different that should be done.

erikattechslice commented 3 years ago

Hi Abdullah, Could you please share your test setup?

I tried going through the docker compose in tripal_elasticsearch but the node health is being read in php as a string instead of an array. I have not had this issue before.

specifically here:

if (!empty($health)) { $header = array_keys($health); $rows[] = array_values($health); $output = theme('table', ['header' => $header, 'rows' => $rows]); $form['health'] = [ '#type' => 'markup', '#title' => t('Elasticsearch Server Health'), '#description' => t( 'The table below shows the health of your local Elasticsearch server.' ), '#markup' => '

' . t('Local Elasticsearch Server Health') . '

' . '

' . t( 'The table below shows the health of your local Elasticsearch server.' ) . '

' . $output, ]; }

On Thu, Dec 10, 2020 at 8:11 PM Abdullah Almsaeed notifications@github.com wrote:

@erikattechslice https://github.com/erikattechslice I managed to test your code to index a small tripal site using Elasticsearch 7.

  • Index gets created without issues.
  • The indexing process went through without errors.
  • But searching the index returns no results.

It's likely that the code we use to bulk index entities/pages is not supported by ES7. I'd go through the elasticsearch-php documentation to see if there is anything different that should be done.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tripal/tripal_elasticsearch/issues/274#issuecomment-742900085, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYKXIOWF3FAI5VKERBNDLLSUFWS7ANCNFSM4URDS6HA .

almasaeed2010 commented 3 years ago

Docker is not working on my Mac for some reason so I switched to Laravel Homestead. If you are familar with Homestead, then I'd strongly recommend using it.

Other than docker, I was also able to set it up directly on my machine but honestly it's a hassle to do it that way.

erikattechslice commented 3 years ago

For the indexes mapping. can we remove the fields section? Is this being used for something im not seeing? Thanks

-Erik

{ "website" : { "aliases" : { }, "mappings" : { "properties" : { "content" : { "type" : "text", "fields" : { "raw" : { "type" : "text" } } }, "nid" : { "type" : "integer", "fields" : { "raw" : { "type" : "integer" } } }, "title" : { "type" : "text", "fields" : { "raw" : { "type" : "text" } } }, "type" : { "type" : "text", "fields" : { "raw" : { "type" : "text" } } } } }, "settings" : { "index" : { "number_of_shards" : "5", "provided_name" : "website", "max_result_window" : "1000000", "creation_date" : "1607715231068", "analysis" : { "analyzer" : { "website" : { "filter" : [ "lowercase" ], "type" : "custom", "tokenizer" : "standard" } } }, "number_of_replicas" : "0", "uuid" : "wa-9ubSZTtC983ef2Y2Tow", "version" : { "created" : "7090299" } } } } }

On Fri, Dec 11, 2020 at 12:45 PM Abdullah Almsaeed notifications@github.com wrote:

Docker is not working on my Mac for some reason so I switched to Laravel Homestead https://laravel.com/docs/8.x/homestead. If you are familar with Homestead, then I'd strongly recommend using it.

Other than docker, I was also able to set it up directly on my machine but honestly it's a hassle to do it that way.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tripal/tripal_elasticsearch/issues/274#issuecomment-743333202, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYKXINPB5747FHB434D6JLSUJLEDANCNFSM4URDS6HA .