Skip to content

Commit

Permalink
Merge branch 'master' into cache-deadlock
Browse files Browse the repository at this point in the history
* master:
  [Docs] Fix typo in cardinality-aggregation.asciidoc (elastic#30434)
  Avoid NPE in `more_like_this` when field has zero tokens (elastic#30365)
  Build: Switch to building javadoc with html5 (elastic#30440)
  • Loading branch information
jasontedor committed May 8, 2018
2 parents ddbe45a + 3acca0b commit 6051293
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ class BuildPlugin implements Plugin<Project> {
javadoc.classpath = javadoc.getClasspath().filter { f ->
return classes.contains(f) == false
}
/*
* Generate docs using html5 to suppress a warning from `javadoc`
* that the default will change to html5 in the future.
*/
javadoc.options.addBooleanOption('html5', true)
}
configureJavadocJar(project)
}
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ ones that the user is authorized to access in case field level security is enabl
[float]
=== Bug Fixes

Fix NPE in 'more_like_this' when field has zero tokens ({pull}30365[#30365])

Fixed prerelease version of elasticsearch in the `deb` package to sort before GA versions
({pull}29000[#29000])

Expand Down Expand Up @@ -169,6 +171,8 @@ Added put index template API to the high level rest client ({pull}30400[#30400])
[float]
=== Bug Fixes

Fix NPE in 'more_like_this' when field has zero tokens ({pull}30365[#30365])

Do not ignore request analysis/similarity settings on index resize operations when the source index already contains such settings ({pull}30216[#30216])

Fix NPE when CumulativeSum agg encounters null value/empty bucket ({pull}29641[#29641])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ POST /sales/_search?size=0
defines a unique count below which counts are expected to be close to
accurate. Above this value, counts might become a bit more fuzzy. The maximum
supported value is 40000, thresholds above this number will have the same
effect as a threshold of 40000. The default values is +3000+.
effect as a threshold of 40000. The default value is +3000+.

==== Counts are approximate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ void setFields(Fields termVectorsByField, Set<String> selectedFields, EnumSet<Fl
Terms topLevelTerms = topLevelFields.terms(field);

// if no terms found, take the retrieved term vector fields for stats
if (fieldTermVector == null) {
fieldTermVector = EMPTY_TERMS;
}

if (topLevelTerms == null) {
topLevelTerms = EMPTY_TERMS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,36 @@ public void testSimpleMoreLikeThis() throws Exception {
assertHitCount(response, 1L);
}

//Issue #30148
public void testMoreLikeThisForZeroTokensInOneOfTheAnalyzedFields() throws Exception {
CreateIndexRequestBuilder createIndexRequestBuilder = prepareCreate("test")
.addMapping("type", jsonBuilder()
.startObject().startObject("type")
.startObject("properties")
.startObject("myField").field("type", "text").endObject()
.startObject("empty").field("type", "text").endObject()
.endObject()
.endObject().endObject());

assertAcked(createIndexRequestBuilder);

ensureGreen();

client().index(indexRequest("test").type("type").id("1").source(jsonBuilder().startObject()
.field("myField", "and_foo").field("empty", "").endObject())).actionGet();
client().index(indexRequest("test").type("type").id("2").source(jsonBuilder().startObject()
.field("myField", "and_foo").field("empty", "").endObject())).actionGet();

client().admin().indices().refresh(refreshRequest()).actionGet();

SearchResponse searchResponse = client().prepareSearch().setQuery(
moreLikeThisQuery(new String[]{"myField", "empty"}, null, new Item[]{new Item("test", "type", "1")})
.minTermFreq(1).minDocFreq(1)
).get();

assertHitCount(searchResponse, 1L);
}

public void testSimpleMoreLikeOnLongField() throws Exception {
logger.info("Creating index test");
assertAcked(prepareCreate("test")
Expand Down

0 comments on commit 6051293

Please sign in to comment.