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

Support for indexing serialized arrays #347

Open
mweimerskirch opened this issue Nov 29, 2017 · 4 comments
Open

Support for indexing serialized arrays #347

mweimerskirch opened this issue Nov 29, 2017 · 4 comments

Comments

@mweimerskirch
Copy link

Many plugins store data (e. g. repeatable text boxes) as serialized arrays in the post_meta table. Example:

a:4:{i:0;a:1:{s:11:"description";s:298:"Lorem ipsum dolor sit amet,...

Indexing those fields can lead to unwanted search results as control characters and array keys are included. One way to solve this would be using the "solr_build_document" filter to replace the fields in the solr document before sending it to the server.

The solution I propose would make this easier by automatically "flattening" serialized arrays. The related pull request can be found under #346.

@danielbachhuber
Copy link
Contributor

The solution I propose would make this easier by automatically "flattening" serialized arrays.

What unexpected, undesirable edge cases could we encounter with this approach?

Also, it'd be worthwhile to see how the other search plugins handle this (ElasticPress and others).

@mweimerskirch
Copy link
Author

mweimerskirch commented Nov 29, 2017

What unexpected, undesirable edge cases could we encounter with this approach?

The original content is no longer indexed in the "*_s" field, so if anyone used the content from the Solr results for display purposes and relied on the exact content of that field, that would no longer work. The original content is however still stored in the "*_str" field, so that use case would still be possible.

@danielbachhuber
Copy link
Contributor

Ok, I'm amenable to this change.

@danielbachhuber danielbachhuber self-assigned this Sep 5, 2018
@ataylorme ataylorme added this to the 2.0.0 milestone Sep 5, 2018
@danielbachhuber danielbachhuber removed this from the 2.0.0 milestone Sep 7, 2018
@danielbachhuber
Copy link
Contributor

@ataylorme I'm going to move this out of 2.0.0 because I think it's worth spending more than 30 minutes on to get right, per conversation in #346 (comment)

@danielbachhuber danielbachhuber removed their assignment Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants