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

Use _doc doc type instead of doc #581

Merged
merged 2 commits into from
Jul 30, 2018
Merged

Use _doc doc type instead of doc #581

merged 2 commits into from
Jul 30, 2018

Conversation

dadoonet
Copy link
Owner

Closes #552.

@dadoonet dadoonet added the new For new features or options label Jul 30, 2018
@dadoonet dadoonet added this to the 2.5 milestone Jul 30, 2018
@dadoonet dadoonet self-assigned this Jul 30, 2018
Copy link

@sonarqubecloud sonarqubecloud bot left a comment

Choose a reason for hiding this comment

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

SonarQube analysis found issues:
Bug Bugs: 0
Vulnerability Vulnerabilities: 0
Code Smell Code Smells: 8

See all issues in SonarCloud

* @deprecated Will be removed with Elasticsearch V8
*/
@Deprecated
private static final String INDEX_TYPE_DOC = "_doc";

Choose a reason for hiding this comment

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

Code Smell Code Smell: Do not forget to remove this deprecated code someday. (squid:S1133)

See it in SonarCloud


// With elasticsearch 6.x, we can use _doc as the default type name
if (VERSION.onOrAfter(Version.V_6_0_0)) {
logger.debug("Using elasticsearch >= 6, so we can use {} as the default type name", defaultTypeName);

Choose a reason for hiding this comment

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

Code Smell Code Smell: Remove this use of "defaultTypeName"; it is deprecated. (squid:CallToDeprecatedMethod)

See it in SonarCloud

logger.debug("Using elasticsearch >= 6, so we can use {} as the default type name", defaultTypeName);
} else {
defaultTypeName = INDEX_TYPE_DOC_V5;
logger.debug("Using elasticsearch < 6, so we use {} as the default type name", defaultTypeName);

Choose a reason for hiding this comment

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

Code Smell Code Smell: Remove this use of "defaultTypeName"; it is deprecated. (squid:CallToDeprecatedMethod)

See it in SonarCloud

* @deprecated Will be removed with Elasticsearch V8
*/
@Deprecated
private String defaultTypeName = INDEX_TYPE_DOC;

Choose a reason for hiding this comment

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

Code Smell Code Smell: Do not forget to remove this deprecated code someday. (squid:S1133)

See it in SonarCloud

if (VERSION.onOrAfter(Version.V_6_0_0)) {
logger.debug("Using elasticsearch >= 6, so we can use {} as the default type name", defaultTypeName);
} else {
defaultTypeName = INDEX_TYPE_DOC_V5;

Choose a reason for hiding this comment

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

Code Smell Code Smell: Remove this use of "INDEX_TYPE_DOC_V5"; it is deprecated. (squid:CallToDeprecatedMethod)

See it in SonarCloud

if (VERSION.onOrAfter(Version.V_6_0_0)) {
logger.debug("Using elasticsearch >= 6, so we can use {} as the default type name", defaultTypeName);
} else {
defaultTypeName = INDEX_TYPE_DOC_V5;

Choose a reason for hiding this comment

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

Code Smell Code Smell: Remove this use of "defaultTypeName"; it is deprecated. (squid:CallToDeprecatedMethod)

See it in SonarCloud

* @deprecated Will be removed with Elasticsearch V8
*/
@Deprecated
private static final String INDEX_TYPE_DOC_V5 = "doc";

Choose a reason for hiding this comment

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

Code Smell Code Smell: Do not forget to remove this deprecated code someday. (squid:S1133)

See it in SonarCloud

@@ -291,6 +317,10 @@ public Version getVersion() {
return VERSION;
}

public String getDefaultTypeName() {
return defaultTypeName;

Choose a reason for hiding this comment

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

Code Smell Code Smell: Remove this use of "defaultTypeName"; it is deprecated. (squid:CallToDeprecatedMethod)

See it in SonarCloud

@dadoonet dadoonet merged commit 775cf15 into master Jul 30, 2018
@dadoonet dadoonet deleted the pr/_doc branch July 30, 2018 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new For new features or options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant