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

Fixed an equality check in StringFieldMapper. #10359

Closed
wants to merge 2 commits into from
Closed

Fixed an equality check in StringFieldMapper. #10359

wants to merge 2 commits into from

Conversation

jtibshirani
Copy link
Contributor

The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes #10357

The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes #10357
@javanna
Copy link
Member

javanna commented Apr 1, 2015

Hi @jtibshirani thanks a lot for your PR! Would it be possible to have a test along with your fix? Let me know if you need help with that.

@jtibshirani
Copy link
Contributor Author

I took a stab at a test, thanks!

@SuppressWarnings("unchecked")
Map<String, Object> result = (Map<String, Object>) fieldMap.get(fieldName);
return result;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good test, would be better to move it to a brand new class though, as this existing test class starts a single node cluster but you don't need to send any requests to it. This is a pure unit test, you can call it StringFieldMapperXContentTests and make it extend ElasticsearchTestCase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, scratch that, you need parser, which needs the indexService, which needs an index on the cluster. It's all good, leave the test where it is. ;)

@javanna javanna added :Search/Mapping Index mappings, including merging and defining field types v2.0.0-beta1 v1.6.0 v1.5.1 and removed v1.5.1 v1.6.0 v2.0.0-beta1 labels Apr 2, 2015
@javanna
Copy link
Member

javanna commented Apr 2, 2015

@rjernst would you mind taking this over? I had a look and the fix seems ok but the test fails when backporting to 1.x, not sure why, I am not too familiar with mappings code.

@javanna javanna assigned rjernst and unassigned javanna Apr 2, 2015
@rjernst
Copy link
Member

rjernst commented Apr 2, 2015

This change looks good, I will merge later today.

@rjernst
Copy link
Member

rjernst commented Apr 2, 2015

@javanna I'm sure the test fails because 1.x has different behavior than master for specifying analyzers (how analyzer/index_analyzer/search_analyzer relate to each other). I'll get it working on the backport.

@javanna
Copy link
Member

javanna commented Apr 3, 2015

thanks @rjernst !

@jtibshirani
Copy link
Contributor Author

Just wanted to check the status on this and see if there's anything more I can do!

@rjernst rjernst closed this in dc17427 Apr 17, 2015
rjernst pushed a commit that referenced this pull request Apr 17, 2015
The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes #10357
closes #10359
rjernst pushed a commit that referenced this pull request Apr 17, 2015
The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes #10357
closes #10359
@rjernst
Copy link
Member

rjernst commented Apr 17, 2015

Thanks @jtibshirani! Sorry it took so long to get around to this. The backport required updating the tests to use index_analyzer instead of analyzer.

@jtibshirani jtibshirani deleted the quote-analyzer branch April 17, 2015 20:53
brwe pushed a commit to brwe/elasticsearch that referenced this pull request Apr 18, 2015
The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes elastic#10357
closes elastic#10359
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
The check was ineffective and was causing search_quote_analyzer to be added to the mapping unnecessarily.

Closes elastic#10357
closes elastic#10359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Mapping Index mappings, including merging and defining field types v1.5.2 v1.6.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

search_quote_analyzer always added to mapping when position_offset_gap is specified
4 participants