Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# When updating elasticsearch, please update 'rest' version in core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy
elasticsearch = 6.0.0-alpha1
lucene = 6.5.0-snapshot-f919485
lucene = 6.5.0-snapshot-d00c5ca

# optional dependencies
spatial4j = 0.6
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9ad2a7bd252cbdb76ac121287e670d75f4db2cd3

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c6a940eff8a87df40262b752ed7b135e448b7873

This file was deleted.

1 change: 1 addition & 0 deletions core/licenses/lucene-core-6.5.0-snapshot-d00c5ca.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6ef5ad88141760c00ea041da1535f3ffc364d67d
1 change: 0 additions & 1 deletion core/licenses/lucene-core-6.5.0-snapshot-f919485.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f15775571fb5762dfc92e00c3909cb8db8ff1d53

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
051d793aa64257beead4ccc7432eb5df81d17f23

This file was deleted.

1 change: 1 addition & 0 deletions core/licenses/lucene-join-6.5.0-snapshot-d00c5ca.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5bc4cba55670c14ea812ff5de65edad4c312fdf6
1 change: 0 additions & 1 deletion core/licenses/lucene-join-6.5.0-snapshot-f919485.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
68cf08bcd8414a57493debf3a6a509d78a9abb56

This file was deleted.

1 change: 1 addition & 0 deletions core/licenses/lucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f5d90756dbeda1218d723b7bea0799c88d621adb
1 change: 0 additions & 1 deletion core/licenses/lucene-misc-6.5.0-snapshot-f919485.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9298e7d1ed96e7beb63d7ccdce1a4502eb0fe484

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
918de18963607af69dff38e4773c0bde89c73ae3

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a311a7d9f3e9a8fbf3a367a4e2731f9d4579732b

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
693bc4cb0e2e4465e0173c67ed0818071c4b460b

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0326f31e63c76d476c23488c7354265cf915350f

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
69a3a86e9d045f872408793ea411d49e0c577268

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fabc05ca175150171cf60370877276b933716bcd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.search.GraphQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.PhraseQuery;
Expand Down Expand Up @@ -747,6 +746,8 @@ private Query applySlop(Query q, int slop) {
MultiPhraseQuery.Builder builder = new MultiPhraseQuery.Builder((MultiPhraseQuery) q);
builder.setSlop(slop);
return builder.build();
// nocommit
/*
} else if (q instanceof GraphQuery && ((GraphQuery) q).hasPhrase()) {
// we have a graph query that has at least one phrase sub-query
// re-build and set slop on all phrase queries
Expand All @@ -762,6 +763,7 @@ private Query applySlop(Query q, int slop) {
}

return new GraphQuery(queries);
*/
} else {
return q;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public ScoreDoc[] sortDocs(boolean ignoreFrom, AtomicArray<? extends QuerySearch
// the 'index' field is the position in the resultsArr atomic array
shardTopDocs[sortedResult.index] = (TopFieldDocs) topDocs;
}
mergedTopDocs = TopDocs.merge(sort, from, topN, shardTopDocs);
mergedTopDocs = TopDocs.merge(sort, from, topN, shardTopDocs, true);
} else {
final TopDocs[] shardTopDocs = new TopDocs[resultsArr.length()];
if (result.size() != shardTopDocs.length) {
Expand All @@ -274,7 +274,7 @@ public ScoreDoc[] sortDocs(boolean ignoreFrom, AtomicArray<? extends QuerySearch
// the 'index' field is the position in the resultsArr atomic array
shardTopDocs[sortedResult.index] = topDocs;
}
mergedTopDocs = TopDocs.merge(from, topN, shardTopDocs);
mergedTopDocs = TopDocs.merge(from, topN, shardTopDocs, true);
}

ScoreDoc[] scoreDocs = mergedTopDocs.scoreDocs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/
package org.elasticsearch.index.analysis;

import java.io.Reader;
import java.util.regex.Pattern;

import org.apache.lucene.analysis.pattern.PatternReplaceCharFilter;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;

import java.io.Reader;
import java.util.regex.Pattern;

public class PatternReplaceCharFilterFactory extends AbstractCharFilterFactory {
public class PatternReplaceCharFilterFactory extends AbstractCharFilterFactory implements MultiTermAwareComponent {

private final Pattern pattern;
private final String replacement;
Expand Down Expand Up @@ -56,4 +56,9 @@ public String getReplacement() {
public Reader create(Reader tokenStream) {
return new PatternReplaceCharFilter(pattern, replacement, tokenStream);
}

@Override
public Object getMultiTermComponent() {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.search.GraphQuery;
import org.apache.lucene.search.MultiPhraseQuery;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.PhraseQuery;
Expand Down Expand Up @@ -318,6 +317,8 @@ protected Query newSynonymQuery(Term[] terms) {

public Query createPhrasePrefixQuery(String field, String queryText, int phraseSlop, int maxExpansions) {
final Query query = createFieldQuery(getAnalyzer(), Occur.MUST, field, queryText, true, phraseSlop);
// nocommit
/*
if (query instanceof GraphQuery) {
// we have a graph query, convert inner queries to multi phrase prefix queries
List<Query> oldQueries = ((GraphQuery) query).getQueries();
Expand All @@ -328,6 +329,7 @@ public Query createPhrasePrefixQuery(String field, String queryText, int phraseS

return new GraphQuery(queries);
}
*/

return toMultiPhrasePrefix(query, phraseSlop, maxExpansions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public InternalAggregation doReduce(List<InternalAggregation> aggregations, Redu
shardDocs[i] = topHitsAgg.topDocs;
shardHits[i] = topHitsAgg.searchHits;
}
reducedTopDocs = TopDocs.merge(sort, from, size, (TopFieldDocs[]) shardDocs);
reducedTopDocs = TopDocs.merge(sort, from, size, (TopFieldDocs[]) shardDocs, true);
} else {
shardDocs = new TopDocs[aggregations.size()];
for (int i = 0; i < shardDocs.length; i++) {
InternalTopHits topHitsAgg = (InternalTopHits) aggregations.get(i);
shardDocs[i] = topHitsAgg.topDocs;
shardHits[i] = topHitsAgg.searchHits;
}
reducedTopDocs = TopDocs.merge(from, size, shardDocs);
reducedTopDocs = TopDocs.merge(from, size, shardDocs, true);
}

final int[] tracker = new int[shardHits.length];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Weight getWeight() {
}

@Override
public Collection<ChildScorer> getChildren() {
public Collection<ChildScorer> getChildren() throws IOException {
return scorer.getChildren();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ public SuggestDoc[] getResults() {
private final SuggestDocPriorityQueue pq;
private final Map<Integer, SuggestDoc> scoreDocMap;

// TODO: expose dup removal

TopDocumentsCollector(int num) {
super(1); // TODO hack, we don't use the underlying pq, so we allocate a size of 1
super(1, false); // TODO hack, we don't use the underlying pq, so we allocate a size of 1
this.num = num;
this.scoreDocMap = new LinkedHashMap<>(num);
this.pq = new SuggestDocPriorityQueue(num);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ grant codeBase "${codebase.securesm-1.1.jar}" {
//// Very special jar permissions:
//// These are dangerous permissions that we don't want to grant to everything.

grant codeBase "${codebase.lucene-core-6.5.0-snapshot-f919485.jar}" {
grant codeBase "${codebase.lucene-core-6.5.0-snapshot-d00c5ca.jar}" {
// needed to allow MMapDirectory's "unmap hack" (die unmap hack, die)
// java 8 package
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
Expand All @@ -42,7 +42,7 @@ grant codeBase "${codebase.lucene-core-6.5.0-snapshot-f919485.jar}" {
permission java.lang.RuntimePermission "accessDeclaredMembers";
};

grant codeBase "${codebase.lucene-misc-6.5.0-snapshot-f919485.jar}" {
grant codeBase "${codebase.lucene-misc-6.5.0-snapshot-d00c5ca.jar}" {
// needed to allow shard shrinking to use hard-links if possible via lucenes HardlinkCopyDirectoryWrapper
permission java.nio.file.LinkPermission "hard";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ grant codeBase "${codebase.securemock-1.2.jar}" {
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "${codebase.lucene-test-framework-6.5.0-snapshot-f919485.jar}" {
grant codeBase "${codebase.lucene-test-framework-6.5.0-snapshot-d00c5ca.jar}" {
// needed by RamUsageTester
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
// needed for testing hardlinks in StoreRecoveryTests since we install MockFS
Expand Down
Loading