diff --git a/eclipse-pydev.spec b/eclipse-pydev.spec
index bcdcceb..1acd38c 100644
--- a/eclipse-pydev.spec
+++ b/eclipse-pydev.spec
@@ -33,8 +33,7 @@ Patch5: encoding-tolerance.patch
Patch6: exclude-project-files.patch
# Upgrade to Lucene 6.1.0 - https://github.com/fabioz/Pydev/pull/196.diff
-Patch7: upgrade-to-lucene-6.1.0-PR196_1.patch
-Patch8: upgrade-to-lucene-6.1.0-PR196_2.patch
+Patch7: upgrade-to-lucene-6.1.0-PR196.patch
Requires: eclipse-platform
Requires: python3
@@ -97,7 +96,6 @@ Mylyn Task-Focused UI extensions for Pydev.
%patch6
%if 0%{?fedora} >= 27
%patch7 -p1
-%patch8 -p1
%endif
%mvn_package "::pom:" __noinstall
diff --git a/upgrade-to-lucene-6.1.0-PR196.patch b/upgrade-to-lucene-6.1.0-PR196.patch
new file mode 100644
index 0000000..743c750
--- /dev/null
+++ b/upgrade-to-lucene-6.1.0-PR196.patch
@@ -0,0 +1,158 @@
+diff --git a/plugins/org.python.pydev.shared_core/.classpath b/plugins/org.python.pydev.shared_core/.classpath
+index a950a36..f8225c6 100644
+--- a/plugins/org.python.pydev.shared_core/.classpath
++++ b/plugins/org.python.pydev.shared_core/.classpath
+@@ -3,9 +3,9 @@
+
+
+
+-
+-
+
+
++
++
+
+
+diff --git a/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF b/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
+index e293dd9..b4b3660 100644
+--- a/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
++++ b/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
+@@ -5,8 +5,8 @@ Bundle-SymbolicName: org.python.pydev.shared_core;singleton:=true
+ Bundle-Version: 5.6.0.qualifier
+ Bundle-ClassPath: shared_core.jar,
+ libs/snakeyaml-1.11.jar,
+- libs/lucene-analyzers-common-5.2.1.jar,
+- libs/lucene-core-5.2.1.jar
++ libs/lucene-analyzers-common-6.1.0.jar,
++ libs/lucene-core-6.1.0.jar
+ Bundle-Activator: org.python.pydev.shared_core.SharedCorePlugin
+ Bundle-Localization: plugin
+ Eclipse-BundleShape: dir
+diff --git a/plugins/org.python.pydev.shared_core/build.properties b/plugins/org.python.pydev.shared_core/build.properties
+index 3af32ce..8af3a06 100644
+--- a/plugins/org.python.pydev.shared_core/build.properties
++++ b/plugins/org.python.pydev.shared_core/build.properties
+@@ -2,11 +2,11 @@ bin.includes = shared_core.jar,\
+ META-INF/,\
+ LICENSE.txt,\
+ libs/,\
+- libs/lucene-analyzers-common-5.2.1.jar,\
+- libs/lucene-core-5.2.1.jar
++ libs/lucene-analyzers-common-6.1.0.jar,\
++ libs/lucene-core-6.1.0.jar
+ jars.compile.order = shared_core.jar
+ source.shared_core.jar = src/
+ output.shared_core.jar = bin/
+ jars.extra.classpath = libs/snakeyaml-1.11.jar,\
+- libs/lucene-core-5.1.0.jar,\
+- libs/lucene-analyzers-common-5.1.0.jar
++ libs/lucene-core-6.1.0.jar,\
++ libs/lucene-analyzers-common-6.1.0.jar
+diff --git a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
+index 3a3c627..d0b7666 100644
+--- a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
++++ b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
+@@ -40,6 +40,7 @@
+ import org.apache.lucene.index.Term;
+ import org.apache.lucene.search.BooleanClause;
+ import org.apache.lucene.search.BooleanQuery;
++import org.apache.lucene.search.BooleanQuery.Builder;
+ import org.apache.lucene.search.IndexSearcher;
+ import org.apache.lucene.search.MatchAllDocsQuery;
+ import org.apache.lucene.search.Query;
+@@ -108,7 +109,7 @@ public void init(boolean applyAllDeletes) throws IOException {
+ }
+
+ searcherFactory = new SearcherFactory();
+- searchManager = new SearcherManager(writer, applyAllDeletes, searcherFactory);
++ searchManager = new SearcherManager(writer, applyAllDeletes, false, searcherFactory);
+ }
+
+ public void registerTokenizer(String fieldName, TokenStreamComponents tokenStream) {
+@@ -274,14 +275,14 @@ public SearchResult searchExact(String string, String fieldName, boolean applyAl
+
+ public SearchResult searchExact(String string, String fieldName, boolean applyAllDeletes, IDocumentsVisitor visitor,
+ String... fieldsToLoad)
+- throws IOException {
++ throws IOException {
+ Query query = new TermQuery(new Term(fieldName, string));
+ return search(query, applyAllDeletes, visitor, fieldsToLoad);
+ }
+
+ public SearchResult searchWildcard(Set string, String fieldName, boolean applyAllDeletes,
+ IDocumentsVisitor visitor, Map translateFields, String... fieldsToLoad)
+- throws IOException {
++ throws IOException {
+ OrderedMap> fieldNameToValues = new OrderedMap<>();
+ fieldNameToValues.put(fieldName, string);
+ return searchWildcard(fieldNameToValues, applyAllDeletes, visitor, translateFields, fieldsToLoad);
+@@ -294,11 +295,11 @@ public SearchResult searchWildcard(Set string, String fieldName, boolean
+ */
+ public SearchResult searchWildcard(OrderedMap> fieldNameToValues, boolean applyAllDeletes,
+ IDocumentsVisitor visitor, Map translateFields, String... fieldsToLoad)
+- throws IOException {
+- BooleanQuery booleanQuery = new BooleanQuery();
++ throws IOException {
++ Builder booleanQueryBuilder = new BooleanQuery.Builder();
+ Set>> entrySet = fieldNameToValues.entrySet();
+ for (Entry> entry : entrySet) {
+- BooleanQuery fieldQuery = new BooleanQuery();
++ Builder fieldQueryBuilder = new BooleanQuery.Builder();
+ String fieldName = entry.getKey();
+ if (translateFields != null) {
+ String newFieldName = translateFields.get(fieldName);
+@@ -327,28 +328,28 @@ public SearchResult searchWildcard(OrderedMap> fieldNameToVa
+ if (StringUtils.containsOnlyWildCards(s)) {
+ throw new RuntimeException("Unable to create term for searching only wildcards: " + s);
+ }
+- fieldQuery.add(new WildcardQuery(new Term(fieldName, s)),
++ fieldQueryBuilder.add(new WildcardQuery(new Term(fieldName, s)),
+ negate ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD);
+
+ } else {
+- fieldQuery.add(new TermQuery(new Term(fieldName, s)),
++ fieldQueryBuilder.add(new TermQuery(new Term(fieldName, s)),
+ negate ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD);
+ }
+ if (!negate) {
+ allNegate = false;
+ }
+ }
+-
+- if (fieldQuery.getClauses().length != 0) {
++ BooleanQuery transitiveQuery = fieldQueryBuilder.build();
++ if (transitiveQuery.clauses().size() != 0) {
+ if (allNegate) {
+ // If all are negations, we actually have to add one which would
+ // match all to remove the negations.
+- fieldQuery.add(new MatchAllDocsQuery(), BooleanClause.Occur.SHOULD);
++ fieldQueryBuilder.add(new MatchAllDocsQuery(), BooleanClause.Occur.SHOULD);
+ }
+- booleanQuery.add(fieldQuery, BooleanClause.Occur.MUST);
++ booleanQueryBuilder.add(fieldQueryBuilder.build(), BooleanClause.Occur.MUST);
+ }
+ }
+-
++ BooleanQuery booleanQuery = booleanQueryBuilder.build();
+ if (DEBUG) {
+ System.out.println("Searching: " + booleanQuery);
+ }
+@@ -396,7 +397,7 @@ public int getDocId() {
+ */
+ public void visitAllDocs(IDocumentsVisitor visitor, String... fields) throws IOException {
+ boolean applyAllDeletes = true;
+- try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes);) {
++ try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes, false);) {
+
+ IndexSearcher searcher = searcherFactory.newSearcher(reader, null);
+ Query query = new MatchAllDocsQuery();
+@@ -420,7 +421,7 @@ public SearchResult search(Query query, boolean applyAllDeletes, IDocumentsVisit
+ } catch (Exception e) {
+ Log.log(e);
+ }
+- try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes);) {
++ try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes, false);) {
+ IndexSearcher searcher = searcherFactory.newSearcher(reader, null);
+
+ TopDocs search = searcher.search(query, maxMatches);
diff --git a/upgrade-to-lucene-6.1.0-PR196_1.patch b/upgrade-to-lucene-6.1.0-PR196_1.patch
deleted file mode 100644
index 5a6fd15..0000000
--- a/upgrade-to-lucene-6.1.0-PR196_1.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-diff --git a/plugins/org.python.pydev.shared_core/.classpath b/plugins/org.python.pydev.shared_core/.classpath
-index a950a36..f8225c6 100644
---- a/plugins/org.python.pydev.shared_core/.classpath
-+++ b/plugins/org.python.pydev.shared_core/.classpath
-@@ -3,9 +3,9 @@
-
-
-
--
--
-
-
-+
-+
-
-
-diff --git a/plugins/org.python.pydev.shared_core/build.properties b/plugins/org.python.pydev.shared_core/build.properties
-index 3af32ce..8af3a06 100644
---- a/plugins/org.python.pydev.shared_core/build.properties
-+++ b/plugins/org.python.pydev.shared_core/build.properties
-@@ -2,11 +2,11 @@ bin.includes = shared_core.jar,\
- META-INF/,\
- LICENSE.txt,\
- libs/,\
-- libs/lucene-analyzers-common-5.2.1.jar,\
-- libs/lucene-core-5.2.1.jar
-+ libs/lucene-analyzers-common-6.1.0.jar,\
-+ libs/lucene-core-6.1.0.jar
- jars.compile.order = shared_core.jar
- source.shared_core.jar = src/
- output.shared_core.jar = bin/
- jars.extra.classpath = libs/snakeyaml-1.11.jar,\
-- libs/lucene-core-5.1.0.jar,\
-- libs/lucene-analyzers-common-5.1.0.jar
-+ libs/lucene-core-6.1.0.jar,\
-+ libs/lucene-analyzers-common-6.1.0.jar
-diff --git a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
-index 3a3c627..d0b7666 100644
---- a/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
-+++ b/plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/index/IndexApi.java
-@@ -40,6 +40,7 @@
- import org.apache.lucene.index.Term;
- import org.apache.lucene.search.BooleanClause;
- import org.apache.lucene.search.BooleanQuery;
-+import org.apache.lucene.search.BooleanQuery.Builder;
- import org.apache.lucene.search.IndexSearcher;
- import org.apache.lucene.search.MatchAllDocsQuery;
- import org.apache.lucene.search.Query;
-@@ -108,7 +109,7 @@ public void init(boolean applyAllDeletes) throws IOException {
- }
-
- searcherFactory = new SearcherFactory();
-- searchManager = new SearcherManager(writer, applyAllDeletes, searcherFactory);
-+ searchManager = new SearcherManager(writer, applyAllDeletes, false, searcherFactory);
- }
-
- public void registerTokenizer(String fieldName, TokenStreamComponents tokenStream) {
-@@ -274,14 +275,14 @@ public SearchResult searchExact(String string, String fieldName, boolean applyAl
-
- public SearchResult searchExact(String string, String fieldName, boolean applyAllDeletes, IDocumentsVisitor visitor,
- String... fieldsToLoad)
-- throws IOException {
-+ throws IOException {
- Query query = new TermQuery(new Term(fieldName, string));
- return search(query, applyAllDeletes, visitor, fieldsToLoad);
- }
-
- public SearchResult searchWildcard(Set string, String fieldName, boolean applyAllDeletes,
- IDocumentsVisitor visitor, Map translateFields, String... fieldsToLoad)
-- throws IOException {
-+ throws IOException {
- OrderedMap> fieldNameToValues = new OrderedMap<>();
- fieldNameToValues.put(fieldName, string);
- return searchWildcard(fieldNameToValues, applyAllDeletes, visitor, translateFields, fieldsToLoad);
-@@ -294,11 +295,11 @@ public SearchResult searchWildcard(Set string, String fieldName, boolean
- */
- public SearchResult searchWildcard(OrderedMap> fieldNameToValues, boolean applyAllDeletes,
- IDocumentsVisitor visitor, Map translateFields, String... fieldsToLoad)
-- throws IOException {
-- BooleanQuery booleanQuery = new BooleanQuery();
-+ throws IOException {
-+ Builder booleanQueryBuilder = new BooleanQuery.Builder();
- Set>> entrySet = fieldNameToValues.entrySet();
- for (Entry> entry : entrySet) {
-- BooleanQuery fieldQuery = new BooleanQuery();
-+ Builder fieldQueryBuilder = new BooleanQuery.Builder();
- String fieldName = entry.getKey();
- if (translateFields != null) {
- String newFieldName = translateFields.get(fieldName);
-@@ -327,28 +328,28 @@ public SearchResult searchWildcard(OrderedMap> fieldNameToVa
- if (StringUtils.containsOnlyWildCards(s)) {
- throw new RuntimeException("Unable to create term for searching only wildcards: " + s);
- }
-- fieldQuery.add(new WildcardQuery(new Term(fieldName, s)),
-+ fieldQueryBuilder.add(new WildcardQuery(new Term(fieldName, s)),
- negate ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD);
-
- } else {
-- fieldQuery.add(new TermQuery(new Term(fieldName, s)),
-+ fieldQueryBuilder.add(new TermQuery(new Term(fieldName, s)),
- negate ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD);
- }
- if (!negate) {
- allNegate = false;
- }
- }
--
-- if (fieldQuery.getClauses().length != 0) {
-+ BooleanQuery transitiveQuery = fieldQueryBuilder.build();
-+ if (transitiveQuery.clauses().size() != 0) {
- if (allNegate) {
- // If all are negations, we actually have to add one which would
- // match all to remove the negations.
-- fieldQuery.add(new MatchAllDocsQuery(), BooleanClause.Occur.SHOULD);
-+ fieldQueryBuilder.add(new MatchAllDocsQuery(), BooleanClause.Occur.SHOULD);
- }
-- booleanQuery.add(fieldQuery, BooleanClause.Occur.MUST);
-+ booleanQueryBuilder.add(fieldQueryBuilder.build(), BooleanClause.Occur.MUST);
- }
- }
--
-+ BooleanQuery booleanQuery = booleanQueryBuilder.build();
- if (DEBUG) {
- System.out.println("Searching: " + booleanQuery);
- }
-@@ -396,7 +397,7 @@ public int getDocId() {
- */
- public void visitAllDocs(IDocumentsVisitor visitor, String... fields) throws IOException {
- boolean applyAllDeletes = true;
-- try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes);) {
-+ try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes, false);) {
-
- IndexSearcher searcher = searcherFactory.newSearcher(reader, null);
- Query query = new MatchAllDocsQuery();
-@@ -420,7 +421,7 @@ public SearchResult search(Query query, boolean applyAllDeletes, IDocumentsVisit
- } catch (Exception e) {
- Log.log(e);
- }
-- try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes);) {
-+ try (IndexReader reader = DirectoryReader.open(writer, applyAllDeletes, false);) {
- IndexSearcher searcher = searcherFactory.newSearcher(reader, null);
-
- TopDocs search = searcher.search(query, maxMatches);
diff --git a/upgrade-to-lucene-6.1.0-PR196_2.patch b/upgrade-to-lucene-6.1.0-PR196_2.patch
deleted file mode 100644
index 180bdb4..0000000
--- a/upgrade-to-lucene-6.1.0-PR196_2.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF b/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
-index e293dd9..b4b3660 100644
---- a/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
-+++ b/plugins/org.python.pydev.shared_core/META-INF/MANIFEST.MF
-@@ -5,8 +5,8 @@ Bundle-SymbolicName: org.python.pydev.shared_core;singleton:=true
- Bundle-Version: 5.6.0.qualifier
- Bundle-ClassPath: shared_core.jar,
- libs/snakeyaml-1.11.jar,
-- libs/lucene-analyzers-common-5.2.1.jar,
-- libs/lucene-core-5.2.1.jar
-+ libs/lucene-analyzers-common-6.1.0.jar,
-+ libs/lucene-core-6.1.0.jar
- Bundle-Activator: org.python.pydev.shared_core.SharedCorePlugin
- Bundle-Localization: plugin
- Eclipse-BundleShape: dir