This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch lucene-8-upgrade
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/lucene-8-upgrade by this push:
     new 6538321459 Upgrade bundled Lucene from 2.9.4 to 8.11.4
6538321459 is described below

commit 65383214594c61e8ff6e18a70213dc4b6eca7d3c
Author: Jim Jagielski <[email protected]>
AuthorDate: Mon Oct 26 11:05:02 2026 -0400

    Upgrade bundled Lucene from 2.9.4 to 8.11.4
    
    Create branch of some old work in going from Lucene2 -> Lucene8. More 
viable now that we are looking at a 5.0.0 and not a 4.2.x
---
 main/LICENSE                                       | 228 +++++++++++++++++++++
 main/NOTICE                                        |  67 +++++-
 main/configure.ac                                  |  55 ++---
 main/external_deps.lst                             |   6 +-
 main/helpcontent2/settings.pmk                     |   2 +-
 main/helpcontent2/util/target.pmk                  |   2 +-
 main/l10ntools/source/help/HelpFileDocument.java   |   8 +-
 main/l10ntools/source/help/HelpIndexerTool.java    |  98 +++++----
 main/l10ntools/source/help/makefile.mk             |   2 +-
 main/lucene/long_path.patch                        |  35 ----
 main/lucene/lucene-aoo-build.patch                 |  59 ++++++
 main/lucene/lucene-java-version.patch              |  39 ----
 main/lucene/lucene.patch                           |  24 ---
 main/lucene/makefile.mk                            |  25 +--
 main/scp2/source/ooo/file_ooo.scp                  |   4 +-
 main/solenv/ant/externals.xml                      |   4 +-
 main/solenv/inc/extension_helplink.mk              |   4 +-
 .../main/java/com/sun/star/help/HelpSearch.java    |  15 +-
 18 files changed, 450 insertions(+), 227 deletions(-)

diff --git a/main/LICENSE b/main/LICENSE
index 488e5acede..361e9cd4bf 100644
--- a/main/LICENSE
+++ b/main/LICENSE
@@ -1840,3 +1840,231 @@ If you redistribute modified sources, we would 
appreciate that you include in
 the file ChangeLog history information documenting your changes.  Please read
 the FAQ for more information on the distribution of modified source versions.
 ____
+
+For Apache Lucene (lucene-core and lucene-analyzers-common) - built in 
main/lucene/:
+- Apache License 2.0, plus the following notices for code derived by Lucene
+
+Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was
+derived from unicode conversion examples available at
+http://www.unicode.org/Public/PROGRAMS/CVTUTF.  Here is the copyright
+from those sources:
+
+/*
+ * Copyright 2001-2004 Unicode, Inc.
+ * 
+ * Disclaimer
+ * 
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ * 
+ * Limitations on Rights to Redistribute This Code
+ * 
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+
+Some code in core/src/java/org/apache/lucene/util/ArrayUtil.java was
+derived from Python 2.4.2 sources available at
+http://www.python.org. Full license is here:
+
+  http://www.python.org/download/releases/2.4.2/license/
+
+Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was
+derived from Python 3.1.2 sources available at
+http://www.python.org. Full license is here:
+
+  http://www.python.org/download/releases/3.1.2/license/
+
+Some code in core/src/java/org/apache/lucene/util/automaton was
+derived from Brics automaton sources available at
+www.brics.dk/automaton/. Here is the copyright from those sources:
+
+/*
+ * Copyright (c) 2001-2009 Anders Moeller
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
+The levenshtein automata tables in 
core/src/java/org/apache/lucene/util/automaton 
+were automatically generated with the moman/finenight FSA package.
+Here is the copyright for those sources:
+
+# Copyright (c) 2010, Jean-Philippe Barrette-LaPierre, <[email protected]>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was
+derived from ICU (http://www.icu-project.org)
+The full license is available here: 
+  http://source.icu-project.org/repos/icu/icu/trunk/license.html
+
+/*
+ * Copyright (C) 1999-2010, International Business Machines
+ * Corporation and others.  All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a 
copy 
+ * of this software and associated documentation files (the "Software"), to 
deal
+ * in the Software without restriction, including without limitation the 
rights 
+ * to use, copy, modify, merge, publish, distribute, and/or sell copies of the 
+ * Software, and to permit persons to whom the Software is furnished to do so, 
+ * provided that the above copyright notice(s) and this permission notice 
appear 
+ * in all copies of the Software and that both the above copyright notice(s) 
and
+ * this permission notice appear in supporting documentation.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE 
BE 
+ * LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR 
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall 
not 
+ * be used in advertising or otherwise to promote the sale, use or other 
+ * dealings in this Software without prior written authorization of the 
+ * copyright holder.
+ */
+ 
+The following license applies to the Snowball stemmers:
+
+Copyright (c) 2001, Dr Martin Porter
+Copyright (c) 2002, Richard Boulton
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+    * this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+    * notice, this list of conditions and the following disclaimer in the
+    * documentation and/or other materials provided with the distribution.
+    * Neither the name of the copyright holders nor the names of its 
contributors
+    * may be used to endorse or promote products derived from this software
+    * without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The following license applies to the KStemmer:
+
+Copyright © 2003,
+Center for Intelligent Information Retrieval,
+University of Massachusetts, Amherst.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification,
+are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. The names "Center for Intelligent Information Retrieval" and
+"University of Massachusetts" must not be used to endorse or promote products
+derived from this software without prior written permission. To obtain
+permission, contact [email protected].
+
+THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF MASSACHUSETTS AND OTHER CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+core/src/java/org/apache/lucene/util/compress/LZ4.java is a Java
+implementation of the LZ4 (https://github.com/lz4/lz4/tree/dev/lib)
+compression format for Lucene's DataInput/DataOutput abstractions.
+
+LZ4 Library
+Copyright (c) 2011-2016, Yann Collet
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, 
this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+____
diff --git a/main/NOTICE b/main/NOTICE
index 2f98062f20..01f05d67e2 100644
--- a/main/NOTICE
+++ b/main/NOTICE
@@ -25,16 +25,73 @@ Apache projects:
 The notices from these projects are following:
 
 Apache Lucene
-Copyright 2006 The Apache Software Foundation
+Copyright 2001-2021 The Apache Software Foundation
 
-This product includes software developed by
-The Apache Software Foundation (https://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Includes software from other Apache Software Foundation projects,
+including, but not limited to:
+ - Apache Ant
+ - Apache Jakarta Regexp
+ - Apache Commons
+ - Apache Xerces
+
+Brics Automaton (under core/src/java/org/apache/lucene/util/automaton) is
+BSD-licensed, created by Anders Møller. See http://www.brics.dk/automaton/
+
+The levenshtein automata tables (under 
core/src/java/org/apache/lucene/util/automaton) were
+automatically generated with the moman/finenight FSA library, created by
+Jean-Philippe Barrette-LaPierre. This library is available under an MIT 
license,
+see http://sites.google.com/site/rrettesite/moman and
+http://bitbucket.org/jpbarrette/moman/overview/
+
+The class org.apache.lucene.util.WeakIdentityMap was derived from
+the Apache CXF project and is Apache License 2.0.
+
+The class org.apache.lucene.util.compress.LZ4 is a Java rewrite of the LZ4
+compression library (https://github.com/lz4/lz4/tree/dev/lib) that is licensed
+under the 2-clause BSD license.
+(https://opensource.org/licenses/bsd-license.php)
 
 The snowball stemmers in
- contrib/snowball/src/java/net/sf/snowball
+  analysis/common/src/java/net/sf/snowball
+were developed by Martin Porter and Richard Boulton.
+The snowball stopword lists in
+  analysis/common/src/resources/org/apache/lucene/analysis/snowball
 were developed by Martin Porter and Richard Boulton.
 The full snowball package is available from
- http://snowball.tartarus.org/
+  http://snowball.tartarus.org/
+
+The KStem stemmer in
+  analysis/common/src/org/apache/lucene/analysis/en
+was developed by Bob Krovetz and Sergio Guzman-Lara (CIIR-UMass Amherst)
+under the BSD-license.
+
+The Arabic,Persian,Romanian,Bulgarian, Hindi and Bengali analyzers (common) 
come with a default
+stopword list that is BSD-licensed created by Jacques Savoy.  These files 
reside in:
+analysis/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt,
+analysis/common/src/resources/org/apache/lucene/analysis/fa/stopwords.txt,
+analysis/common/src/resources/org/apache/lucene/analysis/ro/stopwords.txt,
+analysis/common/src/resources/org/apache/lucene/analysis/bg/stopwords.txt,
+analysis/common/src/resources/org/apache/lucene/analysis/hi/stopwords.txt,
+analysis/common/src/resources/org/apache/lucene/analysis/bn/stopwords.txt
+See http://members.unine.ch/jacques.savoy/clef/index.html.
+
+The German,Spanish,Finnish,French,Hungarian,Italian,Portuguese,Russian and 
Swedish light stemmers
+(common) are based on BSD-licensed reference implementations created by 
Jacques Savoy and
+Ljiljana Dolamic. These files reside in:
+analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java
+analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java
 
 
 Apache Portable Runtime
diff --git a/main/configure.ac b/main/configure.ac
index 059695490a..af0218cc2e 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -4777,16 +4777,11 @@ if test -n "$with_system_lucene" -o -n 
"$with_system_libs" && \
         AC_MSG_RESULT([external])
         SYSTEM_LUCENE=YES
         if test -z $LUCENE_CORE_JAR; then
-          AC_CHECK_FILE(/usr/share/java/lucene-core-2.9.4.jar,
-            [ LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.9.4.jar ],
-            [
-              AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
-                [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
-                [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
-                   [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
-                   [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
-                  )
-                ]
+          AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
+            [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
+            [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
+               [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
+               [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
               )
             ]
           )
@@ -4796,49 +4791,29 @@ if test -n "$with_system_lucene" -o -n 
"$with_system_libs" && \
         fi
 
         if test -z $LUCENE_ANALYZERS_JAR; then
-          AC_CHECK_FILE(/usr/share/java/lucene-analyzers-2.3.jar,
-            [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar ],
-            [
-              
AC_CHECK_FILE(/usr/share/java/lucene-contrib/lucene-analyzers.jar,
-                [ 
LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar ],
-                [ AC_MSG_ERROR(lucene-analyzers.jar replacement not found.)]
-              )
-            ]
+          AC_CHECK_FILE(/usr/share/java/lucene-analyzers-common.jar,
+            [ LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-common.jar 
],
+            [ AC_MSG_ERROR(lucene-analyzers-common.jar replacement not found.)]
           )
         else
-          AC_CHECK_FILE($LUCENE_CORE_JAR, [],
-               [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
+          AC_CHECK_FILE($LUCENE_ANALYZERS_JAR, [],
+               [ AC_MSG_ERROR(lucene-analyzers-common.jar not found.)], [])
         fi
-        AC_MSG_CHECKING([whether lucene is version 2.x])
+        AC_MSG_CHECKING([whether lucene is version 8.x])
         export LUCENE_CORE_JAR
         if $PERL -e 'use Archive::Zip;
             my $file = "$ENV{'LUCENE_CORE_JAR'}";
             my $zip = Archive::Zip->new( $file );
             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
-            if ( $mf =~ m/Specification-Version: 2.*/ ) {
+            if ( $mf =~ m/Specification-Version: 8\..*/ ) {
                 exit 0;
             } else {
                 exit 1;
             }'; then
             AC_MSG_RESULT([yes])
-         else
-            AC_MSG_RESULT([no])
-            AC_MSG_CHECKING([whether lucene is version 3.x])
-
-            if $PERL -e 'use Archive::Zip;
-                my $file = "$ENV{'LUCENE_CORE_JAR'}";
-                my $zip = Archive::Zip->new( $file );
-                my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
-                if ( $mf =~ m/Specification-Version: 3.*/ ) {
-                    exit 0;
-                } else {
-                    exit 1;
-                }'; then
-                AC_MSG_RESULT([yes])
-             else
-                AC_MSG_ERROR([no, you need lucene 2 or 3])
-             fi
-         fi
+        else
+            AC_MSG_ERROR([no, you need lucene 8.x])
+        fi
 
 else
     AC_MSG_RESULT([internal])
diff --git a/main/external_deps.lst b/main/external_deps.lst
index 114d758882..3acfce9b5f 100644
--- a/main/external_deps.lst
+++ b/main/external_deps.lst
@@ -73,9 +73,9 @@ if ( true )
     URL1 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (SOLAR_JAVA==TRUE && SYSTEM_LUCENE!=YES)
-    MD5 = 17960f35b2239654ba608cf1f3e256b3
-    name = lucene-2.9.4-src.tar.gz
-    URL1 = 
https://archive.apache.org/dist/lucene/java/2.9.4/lucene-2.9.4-src.tar.gz
+    MD5 = 9275dbc22d542d7ca54783867d8628ef
+    name = lucene-8.11.4-src.tgz
+    URL1 = 
https://archive.apache.org/dist/lucene/java/8.11.4/lucene-8.11.4-src.tgz
     URL2 = $(OOO_EXTRAS)$(MD5)-$(name)
 
 if (ENABLE_NSS_MODULE!=NO && SYSTEM_NSS!=YES)
diff --git a/main/helpcontent2/settings.pmk b/main/helpcontent2/settings.pmk
index 0ba3b026af..3ebe4ef13e 100644
--- a/main/helpcontent2/settings.pmk
+++ b/main/helpcontent2/settings.pmk
@@ -26,7 +26,7 @@ 
my_cp:=$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/jaxp.jar$(PATH_SEPERATOR)$(S
 .IF "$(SYSTEM_LUCENE)" == "YES"
 
my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
 .ELSE
-my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-2.9.4-dev.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-2.9.4-dev.jar
+my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-8.11.4.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-common-8.11.4.jar
 .ENDIF
 
 aux_alllangiso:=$(foreach,i,$(alllangiso) $(foreach,j,$(aux_langdirs) 
$(eq,$i,$j  $i $(NULL))))
diff --git a/main/helpcontent2/util/target.pmk 
b/main/helpcontent2/util/target.pmk
index a5425418da..93a1cf1dc6 100644
--- a/main/helpcontent2/util/target.pmk
+++ b/main/helpcontent2/util/target.pmk
@@ -34,7 +34,7 @@ $(LINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) 
$(COMMONMISC)$/$$(@:b:s/_/./:e:
 .IF "$(CHECK_LUCENCE_INDEXER_OUTPUT)" == ""
        $(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" 
com.sun.star.help.HelpIndexerTool -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) 
-zipdir $(MISC)$/ziptmp$(@:b) -o $@.$(INPATH)
 .ELSE
-       $(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" 
com.sun.star.help.HelpIndexerTool -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) 
-zipdir $(MISC)$/ziptmp$(@:b) -o $@.$(INPATH) -checkcfsandsegname _0 _3
+       $(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" 
com.sun.star.help.HelpIndexerTool -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) 
-zipdir $(MISC)$/ziptmp$(@:b) -o $@.$(INPATH) -checkindex
 .ENDIF
    $(RENAME) $@.$(INPATH) $@
 .ELSE
diff --git a/main/l10ntools/source/help/HelpFileDocument.java 
b/main/l10ntools/source/help/HelpFileDocument.java
index b9a6a7add2..5ee3e43603 100644
--- a/main/l10ntools/source/help/HelpFileDocument.java
+++ b/main/l10ntools/source/help/HelpFileDocument.java
@@ -32,6 +32,8 @@ import java.io.StringReader;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.TextField;
 
 /** Lucene Document for help files */
 public class HelpFileDocument
@@ -63,16 +65,16 @@ public class HelpFileDocument
                if( aFile != null )
                {
                        String aPath = "#HLP#" + aModule + "/" + 
aFile.getName();
-                       doc.add(new Field("path", aPath, Field.Store.YES, 
Field.Index.NOT_ANALYZED));
+                       doc.add(new StringField("path", aPath, 
Field.Store.YES));
                }
 
                // Add the caption of the file to a field named "caption".  
Specify a Reader,
                // so that the text of the file is tokenized and indexed, but 
not stored.
-               doc.add( new Field( "caption", getReaderForFile( aCaptionFile ) 
) );
+               doc.add( new TextField( "caption", getReaderForFile( 
aCaptionFile ) ) );
 
                // Add the contents of the file to a field named "content".  
Specify a Reader,
                // so that the text of the file is tokenized and indexed, but 
not stored.
-               doc.add( new Field( "content", getReaderForFile( aContentFile ) 
) );
+               doc.add( new TextField( "content", getReaderForFile( 
aContentFile ) ) );
 
                // return the document
                return doc;
diff --git a/main/l10ntools/source/help/HelpIndexerTool.java 
b/main/l10ntools/source/help/HelpIndexerTool.java
index 2396de456a..ae5091aa7f 100644
--- a/main/l10ntools/source/help/HelpIndexerTool.java
+++ b/main/l10ntools/source/help/HelpIndexerTool.java
@@ -35,29 +35,42 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.analysis.cjk.CJKAnalyzer;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.util.Version;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.NIOFSDirectory;
 
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Date;
 
-/**
-   When this tool is used with long path names on Windows, that is paths which 
start
-   with \\?\, then the caller must make sure that the path is unique. This is 
achieved
-   by removing '.' and '..' from the path. Paths which are created by
-   osl_getSystemPathFromFileURL fulfill this requirement. This is necessary 
because
-   lucene is patched to not use File.getCanonicalPath. See long_path.patch in 
the lucene
-   module.
- */
-
 public class HelpIndexerTool
 {
     public HelpIndexerTool()
        {
     }
 
+    /** Converts a path to a java.nio Path. On Windows the path may start with 
the
+        long path prefix \\?\ (as created by osl_getSystemPathFromFileURL); if 
the
+        runtime rejects it, retry without the prefix.
+    */
+    public static Path toPath( String aPath )
+       {
+        try
+               {
+            return Paths.get( aPath );
+        }
+        catch( InvalidPathException e )
+               {
+            if( aPath.startsWith( "\\\\?\\" ) )
+                return Paths.get( aPath.substring( 4 ) );
+            throw e;
+        }
+    }
+
 
     /**
      * @param args the command line arguments
@@ -75,8 +88,6 @@ public class HelpIndexerTool
         String aLanguageStr = "";
         String aModule = "";
         String aTargetZipFileStr = "";
-        String aCfsName = "";
-        String aSegmentName = "";
 
         // Scan arguments
         //If this tool is invoked in the build process for extensions help,
@@ -87,8 +98,7 @@ public class HelpIndexerTool
         boolean bZipDir = false;
         boolean bSrcDir = false;
         boolean bOutput = false;
-        boolean bCfsName = false;
-        boolean bSegmentName = false;
+        boolean bCheckIndex = false;
 
         int nArgCount = args.length;
         for( int i = 0 ; i < nArgCount ; i++ )
@@ -142,25 +152,9 @@ public class HelpIndexerTool
                 }
                 i++;
             }
-                       else if( "-checkcfsandsegname".equals(args[i]) )
+                       else if( "-checkindex".equals(args[i]) )
                        {
-                if( i + 1 < nArgCount )
-                               {
-                    aCfsName = args[i + 1] + ".cfs";
-                    bCfsName = true;
-                }
-                i++;
-                if( i + 1 < nArgCount )
-                               {
-                    aSegmentName = "segments" + args[i + 1];
-                    bSegmentName = true;
-                }
-                i++;
-                if (!(bCfsName && bSegmentName))
-                {
-                    System.out.println("Usage: HelpIndexer -checkcfsandsegname 
_0 _3 (2 arguments needed)");
-                    System.exit( -1 );
-                }
+                bCheckIndex = true;
             }
         }
 
@@ -184,8 +178,14 @@ public class HelpIndexerTool
         try
                {
             Date start = new Date();
-           Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new 
CJKAnalyzer(Version.LUCENE_29) : (Analyzer)new 
StandardAnalyzer(Version.LUCENE_29);
-           IndexWriter writer = new IndexWriter( 
NIOFSDirectory.open(aIndexDir), analyzer, true, 
IndexWriter.MaxFieldLength.UNLIMITED );
+           Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new 
CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
+           // never mix with the files of an index written by another Lucene 
version
+           deleteRecursively( aIndexDir );
+           IndexWriterConfig aWriterConfig = new IndexWriterConfig( analyzer );
+           aWriterConfig.setOpenMode( IndexWriterConfig.OpenMode.CREATE );
+           aWriterConfig.getMergePolicy().setNoCFSRatio( 1.0 );
+           Directory aLuceneDir = new NIOFSDirectory( toPath( 
aIndexDir.getPath() ) );
+           IndexWriter writer = new IndexWriter( aLuceneDir, aWriterConfig );
                        if( !bExtensionMode )
                    System.out.println( "Lucene: Indexing to directory '" + 
aIndexDir + "'..." );
             int nRet = indexDocs( writer, aModule, bExtensionMode, 
aCaptionFilesDir, aContentFilesDir );
@@ -196,22 +196,32 @@ public class HelpIndexerTool
                                        System.out.println();
                                        System.out.println( "Optimizing ..." );
                                }
-                writer.optimize();
+                writer.forceMerge( 1 );
             }
             writer.close();
+            aLuceneDir.close();
+            // the lock file outlives the writer and would end up in the help 
zip
+            new File( aIndexDir, "write.lock" ).delete();
 
                        boolean bCfsFileOk = true;
                        boolean bSegmentFileOk = true;
-                       if( bCfsName && bSegmentName && !bExtensionMode && nRet 
!= -1 )
+                       if( bCheckIndex && !bExtensionMode && nRet != -1 )
                        {
-                               String aCompleteCfsFileName = aDirToZipStr + 
File.separator + aIndexDirName + File.separator + aCfsName;
-                               String aCompleteSegmentFileName = aDirToZipStr 
+ File.separator + aIndexDirName + File.separator + aSegmentName;
-                               File aCfsFile = new File( aCompleteCfsFileName 
);
-                               File aSegmentFile = new File( 
aCompleteSegmentFileName );
-                               bCfsFileOk = aCfsFile.exists();
-                               bSegmentFileOk = aSegmentFile.exists();
-                               System.out.println( "Checking cfs file " + 
aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") );
-                               System.out.println( "Checking segment file " + 
aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") );
+                               // the segment names depend on the corpus, so 
count files instead
+                               int nCfsFiles = 0;
+                               int nSegmentFiles = 0;
+                               String[] aIndexFiles = aIndexDir.list();
+                               for( int i = 0 ; aIndexFiles != null && i < 
aIndexFiles.length ; i++ )
+                               {
+                                       if( aIndexFiles[i].endsWith( ".cfs" ) )
+                                               nCfsFiles++;
+                                       else if( aIndexFiles[i].startsWith( 
"segments_" ) )
+                                               nSegmentFiles++;
+                               }
+                               bCfsFileOk = ( nCfsFiles == 1 );
+                               bSegmentFileOk = ( nSegmentFiles == 1 );
+                               System.out.println( "Checking cfs file: " + 
nCfsFiles + " found, 1 expected" );
+                               System.out.println( "Checking segment file: " + 
nSegmentFiles + " found, 1 expected" );
                        }
 
                        if( bExtensionMode || bExtension)
diff --git a/main/l10ntools/source/help/makefile.mk 
b/main/l10ntools/source/help/makefile.mk
index f3a3ec6615..053014e61f 100644
--- a/main/l10ntools/source/help/makefile.mk
+++ b/main/l10ntools/source/help/makefile.mk
@@ -95,7 +95,7 @@ JAVACLASSFILES = \
 .IF "$(SYSTEM_LUCENE)" == "YES"
 EXTRAJARFILES += $(LUCENE_CORE_JAR) $(LUCENE_ANALYZERS_JAR)
 .ELSE
-JARFILES += lucene-core-2.9.4-dev.jar lucene-analyzers-2.9.4-dev.jar
+JARFILES += lucene-core-8.11.4.jar lucene-analyzers-common-8.11.4.jar
 .ENDIF
 JAVAFILES = $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java 
$(JAVACLASSFILES)))
 
diff --git a/main/lucene/long_path.patch b/main/lucene/long_path.patch
deleted file mode 100644
index 7ac3bb6dc3..0000000000
--- a/main/lucene/long_path.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- misc/lucene-2.9.4/src/java/org/apache/lucene/store/FSDirectory.java        
2010-11-27 19:21:44.000000000 -0500
-+++ misc/build/lucene-2.9.4/src/java/org/apache/lucene/store/FSDirectory.java  
2012-12-08 19:23:23.000000000 -0500
-@@ -266,7 +266,14 @@
-   public static FSDirectory getDirectory(File file, LockFactory lockFactory)
-     throws IOException
-   {
--    file = getCanonicalPath(file);
-+    String path = file.getPath();
-+    //File.getCanonicalPath fails on Windows with long path names
-+    //Long path names created by osl_getSystemPathFromFileURL are already
-+    //unique because its implementation replaces the occurrences of .. and .
-+    //That is using the com.sun.star.help.HelpIndexer service from c++ is
-+    //relatively safe.
-+    if (!path.startsWith("\\\\?\\"))
-+      file = getCanonicalPath(file);
- 
-     FSDirectory dir;
-     synchronized (DIRECTORIES) {
-@@ -721,7 +728,15 @@
-     ensureOpen();
-     String dirName;                               // name to be hashed
-     try {
--      dirName = directory.getCanonicalPath();
-+      //File.getCanonicalPath fails on Windows with long path names
-+      //Long path names created by osl_getSystemPathFromFileURL are already
-+      //unique because its implementation replaces the occurrences of .. and .
-+      //That is using the com.sun.star.help.HelpIndexer service from c++ is
-+      //relatively safe.
-+      if (!directory.getPath().startsWith("\\\\?\\"))
-+        dirName = directory.getCanonicalPath();
-+      else
-+        dirName = directory.getPath();
-     } catch (IOException e) {
-       throw new RuntimeException(e.toString(), e);
-     }
diff --git a/main/lucene/lucene-aoo-build.patch 
b/main/lucene/lucene-aoo-build.patch
new file mode 100644
index 0000000000..aa47d897f4
--- /dev/null
+++ b/main/lucene/lucene-aoo-build.patch
@@ -0,0 +1,59 @@
+--- misc/build/lucene-8.11.4/aoo-build.xml
++++ misc/build/lucene-8.11.4/aoo-build.xml
+@@ -1 +1,55 @@
+-dummy
++<?xml version="1.0" encoding="UTF-8"?>
++<!-- Minimal AOO build of lucene-core and lucene-analyzers-common.
++     Upstream's build needs Ivy and network access. -->
++<project name="lucene-aoo" default="jar" basedir=".">
++
++  <property name="version" value="8.11.4"/>
++  <property name="out.dir" location="aoo-out"/>
++
++  <!-- Same rule as upstream common-build.xml: source/target flags on Java 8,
++       the release flag elsewhere so no Java 9+ API gets linked. -->
++  <condition property="javac.release.args" value="-source 8 -target 8" 
else="--release 8">
++    <equals arg1="${ant.java.version}" arg2="1.8"/>
++  </condition>
++
++  <macrodef name="build-module">
++    <attribute name="name"/>
++    <attribute name="dir"/>
++    <attribute name="classpath" default=""/>
++    <sequential>
++      <mkdir dir="${out.dir}/@{name}/classes"/>
++      <javac srcdir="@{dir}/src/java" destdir="${out.dir}/@{name}/classes"
++             encoding="UTF-8" includeantruntime="false" debug="on" 
deprecation="off"
++             createMissingPackageInfoClass="false"
++             classpath="@{classpath}">
++        <compilerarg line="${javac.release.args}"/>
++      </javac>
++      <copy todir="${out.dir}/@{name}/classes">
++        <fileset dir="@{dir}/src/resources"/>
++      </copy>
++      <jar destfile="${out.dir}/lucene-@{name}-${version}.jar" 
basedir="${out.dir}/@{name}/classes">
++        <manifest>
++          <attribute name="Specification-Title" value="Lucene Search Engine: 
@{name}"/>
++          <attribute name="Specification-Version" value="${version}"/>
++          <attribute name="Specification-Vendor" value="The Apache Software 
Foundation"/>
++          <attribute name="Implementation-Title" value="org.apache.lucene"/>
++          <attribute name="Implementation-Version" value="${version}"/>
++          <attribute name="Implementation-Vendor" value="The Apache Software 
Foundation"/>
++          <attribute name="X-Compile-Source-JDK" value="8"/>
++          <attribute name="X-Compile-Target-JDK" value="8"/>
++        </manifest>
++        <metainf dir="." includes="LICENSE.txt,NOTICE.txt"/>
++      </jar>
++    </sequential>
++  </macrodef>
++
++  <target name="jar">
++    <build-module name="core" dir="core"/>
++    <build-module name="analyzers-common" dir="analysis/common"
++                  classpath="${out.dir}/core/classes"/>
++  </target>
++
++  <target name="clean">
++    <delete dir="${out.dir}"/>
++  </target>
++</project>
diff --git a/main/lucene/lucene-java-version.patch 
b/main/lucene/lucene-java-version.patch
deleted file mode 100644
index b674733d1e..0000000000
--- a/main/lucene/lucene-java-version.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- misc/build/lucene-2.9.4/common-build.xml   2018-03-05 06:13:00.041924900 
+0200
-+++ misc/build/lucene-2.9.4/common-build.xml   2018-03-05 06:34:48.448742000 
+0200
-@@ -58,8 +58,8 @@
- 
-   <property name="javac.deprecation" value="off"/>
-   <property name="javac.debug" value="on"/>
--  <property name="javac.source" value="1.4"/>
--  <property name="javac.target" value="1.4"/>
-+  <property name="javac.source" value="1.8"/>
-+  <property name="javac.target" value="1.8"/>
- 
-   <property name="javadoc.link" 
value="http://java.sun.com/j2se/1.4/docs/api/"/>
-   <property name="javadoc.access" value="protected"/>
---- misc/build/lucene-2.9.4/contrib/analyzers/common/build.xml 2010-11-28 
02:22:13.000000000 +0200
-+++ misc/build/lucene-2.9.4/contrib/analyzers/common/build.xml 2018-03-05 
06:39:48.913151800 +0200
-@@ -23,8 +23,8 @@
-     Additional Analyzers
-   </description>
- 
--  <property name="javac.source" value="1.4" />
--  <property name="javac.target" value="1.4" />
-+  <property name="javac.source" value="1.8" />
-+  <property name="javac.target" value="1.8" />
-       
-   <property name="build.dir" 
location="../../../build/contrib/analyzers/common" />
-   <property name="dist.dir" location="../../../dist/contrib/analyzers/common" 
/>
---- misc/build/lucene-2.9.4/contrib/analyzers/smartcn/build.xml        
2010-11-28 02:22:11.000000000 +0200
-+++ misc/build/lucene-2.9.4/contrib/analyzers/smartcn/build.xml        
2018-03-05 06:41:07.207097100 +0200
-@@ -23,8 +23,8 @@
-     Smart Chinese Analyzer
-   </description>
- 
--  <property name="javac.source" value="1.4" />
--  <property name="javac.target" value="1.4" />
-+  <property name="javac.source" value="1.8" />
-+  <property name="javac.target" value="1.8" />
-       
-   <property name="build.dir" 
location="../../../build/contrib/analyzers/smartcn" />
-   <property name="dist.dir" 
location="../../../dist/contrib/analyzers/smartcn" />
diff --git a/main/lucene/lucene.patch b/main/lucene/lucene.patch
deleted file mode 100644
index 722a2ea106..0000000000
--- a/main/lucene/lucene.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- lucene-2.9.4/common-build.xml      2012-05-11 17:34:48.000000000 -0500
-+++ misc/build/lucene-2.9.4/common-build.xml   2012-05-11 17:37:20.000000000 
-0500
-@@ -304,7 +304,7 @@
-               <attribute name="Implementation-Title" 
value="org.apache.lucene"/>
-               <!-- impl version can be any string -->
-               <attribute name="Implementation-Version"
--                         value="${version} ${svnversion} - ${DSTAMP} 
${TSTAMP}"/>
-+                         value="${version}"/>
-               <attribute name="Implementation-Vendor"
-                          value="The Apache Software Foundation"/>
-               <attribute name="X-Compile-Source-JDK" 
-@@ -321,12 +321,6 @@
-     <element name="manifest-attributes" optional="yes"/>
-       <element name="metainf-includes" optional="yes"/>
-     <sequential>
--      <!-- If possible, include the svnversion -->
--      <exec dir="." executable="${svnversion.exe}"
--            outputproperty="svnversion" failifexecutionfails="false">
--        <arg line="."/>
--      </exec>
--      
-       <build-manifest/>
-       
-       <jar
diff --git a/main/lucene/makefile.mk b/main/lucene/makefile.mk
index 2d78685af6..f6ed17c684 100644
--- a/main/lucene/makefile.mk
+++ b/main/lucene/makefile.mk
@@ -43,31 +43,26 @@ all:
 
 # --- Files --------------------------------------------------------
 
-LUCENE_MAJOR=2
-LUCENE_MINOR=9
+LUCENE_MAJOR=8
+LUCENE_MINOR=11
 LUCENE_MICRO=4
 
 LUCENE_NAME=lucene-$(LUCENE_MAJOR).$(LUCENE_MINOR).$(LUCENE_MICRO)
-# NOTE that the jar names do not contain the micro version
-LUCENE_CORE_JAR=lucene-core-$(LUCENE_MAJOR).$(LUCENE_MINOR).$(LUCENE_MICRO)-dev.jar
-LUCENE_ANALYZERS_JAR=lucene-analyzers-$(LUCENE_MAJOR).$(LUCENE_MINOR).$(LUCENE_MICRO)-dev.jar
+LUCENE_CORE_JAR=lucene-core-$(LUCENE_MAJOR).$(LUCENE_MINOR).$(LUCENE_MICRO).jar
+LUCENE_ANALYZERS_JAR=lucene-analyzers-common-$(LUCENE_MAJOR).$(LUCENE_MINOR).$(LUCENE_MICRO).jar
 
 TARFILE_NAME=$(LUCENE_NAME)-src
-TARFILE_MD5=17960f35b2239654ba608cf1f3e256b3
+TARFILE_MD5=9275dbc22d542d7ca54783867d8628ef
 TARFILE_ROOTDIR=$(LUCENE_NAME)
 
-PATCH_FILES=lucene.patch
-
-.IF "$(OS)" == "WNT"
-PATCH_FILES+= long_path.patch
-.ENDIF
-
-PATCH_FILES+=lucene-java-version.patch
+# Upstream's Ant build needs Ivy and network access; this adds a minimal one.
+ADDITIONAL_FILES=aoo-build.xml
+PATCH_FILES=lucene-aoo-build.patch
 
 BUILD_DIR=.
-BUILD_ACTION= ${ANT} -buildfile .$/contrib$/analyzers$/build.xml
+BUILD_ACTION= ${ANT} -buildfile aoo-build.xml
 
-OUT2BIN=.$/build$/$(LUCENE_CORE_JAR) 
.$/build$/contrib$/analyzers/common$/$(LUCENE_ANALYZERS_JAR)
+OUT2BIN=.$/aoo-out$/$(LUCENE_CORE_JAR) .$/aoo-out$/$(LUCENE_ANALYZERS_JAR)
 
 .ELSE                  # $(SOLAR_JAVA)!= ""
 nojava:
diff --git a/main/scp2/source/ooo/file_ooo.scp 
b/main/scp2/source/ooo/file_ooo.scp
index f58145771a..e3ad9573a2 100644
--- a/main/scp2/source/ooo/file_ooo.scp
+++ b/main/scp2/source/ooo/file_ooo.scp
@@ -382,8 +382,8 @@ STD_JAR_FILE( gid_File_Jar_Bsh, bsh )
 #endif
 
 #if defined SOLAR_JAVA && ! defined SYSTEM_LUCENE
-STD_JAR_FILE( gid_File_Jar_Lucene_Core, lucene-core-2.9.4-dev )
-STD_JAR_FILE( gid_File_Jar_Lucene_Analyzers, lucene-analyzers-2.9.4-dev )
+STD_JAR_FILE( gid_File_Jar_Lucene_Core, lucene-core-8.11.4 )
+STD_JAR_FILE( gid_File_Jar_Lucene_Analyzers, lucene-analyzers-common-8.11.4 )
 #endif
 
 
diff --git a/main/solenv/ant/externals.xml b/main/solenv/ant/externals.xml
index f6bb8470a2..60ae6b8944 100644
--- a/main/solenv/ant/externals.xml
+++ b/main/solenv/ant/externals.xml
@@ -71,12 +71,12 @@
         name="lucene-core"
         system-test="${SYSTEM_LUCENE}"
         system-path="${LUCENE_CORE_JAR}"
-        internal-filename="lucene-core-2.9.4-dev.jar"/>
+        internal-filename="lucene-core-8.11.4.jar"/>
 
     <define-external
         name="lucene-analyzers"
         system-test="${SYSTEM_LUCENE}"
         system-path="${LUCENE_ANALYZERS_JAR}"
-        internal-filename="lucene-analyzers-2.9.4-dev.jar"/>
+        internal-filename="lucene-analyzers-common-8.11.4.jar"/>
 
 </project>
diff --git a/main/solenv/inc/extension_helplink.mk 
b/main/solenv/inc/extension_helplink.mk
index 7f5a813f9a..936cb466a6 100644
--- a/main/solenv/inc/extension_helplink.mk
+++ b/main/solenv/inc/extension_helplink.mk
@@ -26,7 +26,7 @@ 
my_cp:=$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)/jaxp.jar$(PATH_SEPERATOR)$(SO
 .IF "$(SYSTEM_LUCENE)" == "YES"
 
my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
 .ELSE
-my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-2.9.4-dev.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-2.9.4-dev.jar
+my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-8.11.4.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-common-8.11.4.jar
 .ENDIF
 
 #aux_alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(aux_langdirs) 
$(eq,$i,$j  $i $(NULL))))
@@ -59,7 +59,7 @@ $(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) 
$(XHPLINKSRC)/$$(@:b:s/_/./
 .IF "$(CHECK_LUCENCE_INDEXER_OUTPUT)" == ""
        $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp 
"$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang 
$(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir 
$(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && $(TOUCH) $@
 .ELSE
-       $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp 
"$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang 
$(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir 
$(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -checkcfsandsegname _0 
_3  && $(TOUCH) $@
+       $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp 
"$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang 
$(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir 
$(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -checkindex  && 
$(TOUCH) $@
 .ENDIF
 .ELSE
        -$(RM) $(XHPLINKSRC)/$(@:b)/content/*.*
diff --git 
a/main/xmlhelp/java/LuceneHelpWrapper/src/main/java/com/sun/star/help/HelpSearch.java
 
b/main/xmlhelp/java/LuceneHelpWrapper/src/main/java/com/sun/star/help/HelpSearch.java
index bc33807c43..97c91632e6 100644
--- 
a/main/xmlhelp/java/LuceneHelpWrapper/src/main/java/com/sun/star/help/HelpSearch.java
+++ 
b/main/xmlhelp/java/LuceneHelpWrapper/src/main/java/com/sun/star/help/HelpSearch.java
@@ -34,26 +34,21 @@ import com.sun.star.uno.Type;
 import com.sun.star.uno.Any;
 import com.sun.star.uno.AnyConverter;
 
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.analysis.cjk.CJKAnalyzer;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
-import org.apache.lucene.search.Searcher;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.WildcardQuery;
-import org.apache.lucene.util.Version;
 import org.apache.lucene.store.NIOFSDirectory;
 
 import com.sun.star.script.XInvocation;
 import com.sun.star.beans.XIntrospectionAccess;
 
-import java.io.File;
 
 /** This class capsulates the class, that implements the minimal component and 
a
  * factory for creating the service (<CODE>__getComponentFactory</CODE>).
@@ -254,10 +249,9 @@ public class HelpSearch
                private static String[] queryImpl( String aLanguageStr, String 
aIndexStr, String aQueryStr,
                        boolean bCaptionOnly, Object[] aScoreOutArray ) throws 
Exception
                {
-                       File aIndexFile = new File( aIndexStr );
-                       IndexReader reader = IndexReader.open( 
NIOFSDirectory.open( aIndexFile ), true );
-                       Searcher searcher = new IndexSearcher( reader );
-                       Analyzer analyzer = aLanguageStr.equals("ja") ? 
(Analyzer)new CJKAnalyzer(Version.LUCENE_29) : (Analyzer)new 
StandardAnalyzer(Version.LUCENE_29);
+                       NIOFSDirectory aDirectory = new NIOFSDirectory( 
HelpIndexerTool.toPath( aIndexStr ) );
+                       IndexReader reader = DirectoryReader.open( aDirectory );
+                       IndexSearcher searcher = new IndexSearcher( reader );
 
                        String aField;
                        if( bCaptionOnly )
@@ -288,6 +282,7 @@ public class HelpSearch
                        aScoreOutArray[0] = aScores;
 
                        reader.close();
+                       aDirectory.close();
 
                        return aDocs;
                }

Reply via email to