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

Entities Indexing error #274

Open
erikattechslice opened this issue Dec 7, 2020 · 6 comments
Open

Entities Indexing error #274

erikattechslice opened this issue Dec 7, 2020 · 6 comments

Comments

@erikattechslice
Copy link

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 👍
$all[] = (object) [
'entity_id' => (int)($entity->id),
'title' => $title,
'bundle_label' => $record->bundle_label,
'content' => $content,
];

any thoughts? Thanks for the help

@almasaeed2010
Copy link
Contributor

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

@erikattechslice
Copy link
Author

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
Copy link
Contributor

@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.

@erikattechslice
Copy link
Author

erikattechslice commented Dec 11, 2020 via email

@almasaeed2010
Copy link
Contributor

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
Copy link
Author

erikattechslice commented Dec 12, 2020 via email

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