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

Does 3.6.0 need to re-index?? #2263

Closed
adiloztaser opened this issue Jul 12, 2021 · 4 comments · Fixed by #2264
Closed

Does 3.6.0 need to re-index?? #2263

adiloztaser opened this issue Jul 12, 2021 · 4 comments · Fixed by #2264
Labels
bug Something isn't working
Milestone

Comments

@adiloztaser
Copy link
Contributor

3.6.0 introduced the new facet field for the posts mapping (#2071). I think the latest version(3.6.0) needs to re-index (@felipeelia also mentioned that in #2071 (comment)) with this new field. But I don't see any information on the changelog. I also don't see the latest version(3.6.0) in the ep_reindex_versions.

$reindex_versions = apply_filters(

I think 3.6.0 should be added to the list of required versions for warning the users about re-indexing but I do not know what can be done after released the version (other than releasing new version?).

I just wanted to inform you after spending my time fixing the indexing problem we faced after the update. If I'm missing something, sorry for waste your time.

@adiloztaser adiloztaser added the bug Something isn't working label Jul 12, 2021
@felipeelia
Copy link
Member

Hi @adiloztaser,

Thanks for opening the issue! That new field is accessible only through custom code at this point, so theoretically, it wouldn't be a problem for anyone other than those who really wrote code searching on that field. Do you mind sharing your use case and which were the errors you got?

@adiloztaser
Copy link
Contributor Author

Hey @felipeelia,

I did not understand well custom code part. We have a bunch of custom search queries but the error we faced occurs after sync the post. I think the reason of the error our index does not have facet field and if we don't put new mapping the facet field type becomes an object. When I tried to sync the post I got following error:

object(stdClass)#8527 (2) { ["error"]=> object(stdClass)#8569 (3) { ["root_cause"]=> array(1) { [0]=> object(stdClass)#8562 (2) { ["type"]=> string(24) "mapper_parsing_exception" ["reason"]=> string(108) "object mapping for [terms.category.facet] tried to parse field [facet] as object, but found a concrete value" } } ["type"]=> string(24) "mapper_parsing_exception" ["reason"]=> string(108) "object mapping for [terms.category.facet] tried to parse field [facet] as object, but found a concrete value" } ["status"]=> int(400) }

After I run elasticpress put-mapping command with new index name and then tried to sync, error has gone.

We are using Elasticsearch 6.3.2 and looks like object is default type for fields? (I did not see any information about it but it looks like that)

I also tried to send facet data as an object instead of keyword without put new mapping, it works.

So ultimately, we need to put new mapping to define facet field type as an keyword or find a way to works with keyword type instead of object. Right now I am not quite sure is related to ElasticPress or our Elasticsearch configuration but I prefer to put new mapping if there is something new.

@felipeelia
Copy link
Member

You are absolutely right @adiloztaser, and that was actually my fault. We are working on a quick release for the next few days but as you've already sent the mapping, you should be good to go.

Just a small clarification though: You don't need to use the put-mapping command in those cases. If you want to reindex your content sending the mapping you can use wp elasticpress index --setup. That --setup flag will make ElasticPress delete the index, send the mapping, and index everything, all with just one command.

Thanks for raising the issue!

@adiloztaser
Copy link
Contributor Author

Hey @felipeelia,

Thanks for working on this. I actually have not sent the new mapping on production, we have more than 700k docs and I wanted to be 100% sure before doing a re-index. I'm planning to do a re-index with 3.6.1 or I'll just unset the new facet field (its looks like we don't need it). I opened the issue for general purpose.

Thank you for the information about commands. I've already known all of ElasticPress commands and I use them. I just feel more comfortable using put-mapping with my sync code when I test new things :)

Thanks again for your work and time!

@felipeelia felipeelia added this to the 3.6.1 milestone Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants