Changeset 29143

Show
Ignore:
Timestamp:
16.07.2014 21:20:11 (5 years ago)
Author:
ak19
Message:

Part of port from lucene3.3.0 to lucene4.7.2. LuceneWrapper? related. Changes to Greenstone3's main src code, build.xml and .classpath file, to swith over from using Lucene3Wrapper to Lucene4Wrapper

Location:
main/trunk/greenstone3
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/.classpath

    r27142 r29143  
    1515    <classpathentry kind="lib" path="gs2build/bin/java/GLIServer.jar"/> 
    1616    <classpathentry kind="lib" path="gs2build/bin/java/JDBMWrapper.jar"/> 
    17     <classpathentry kind="lib" path="gs2build/bin/java/LuceneWrapper3.jar"/> 
     17    <classpathentry kind="lib" path="gs2build/bin/java/LuceneWrapper4.jar"/> 
    1818    <classpathentry kind="lib" path="gs2build/bin/java/xalan.jar"/> 
    1919    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-core-2.3.2.jar"/> 
    2020    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-core-3.3.0.jar"/> 
    21     <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/LuceneWrapper3.jar"/> 
     21    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-core-4.7.2.jar"/> 
     22    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-analyzers-common-4.7.2.jar"/> 
     23    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-analyzers-kuromoji-4.7.2.jar"/> 
     24    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/lib/lucene-analyzers-queryparser-4.7.2.jar"/> 
     25    <classpathentry kind="lib" path="gs2build/common-src/indexers/lucene-gs/LuceneWrapper4.jar"/> 
    2226    <classpathentry kind="lib" path="gs2build/common-src/indexers/mg/mg.jar"/> 
    2327    <classpathentry kind="lib" path="gs2build/common-src/indexers/mgpp/mgpp.jar"/> 
     
    7579    <classpathentry kind="lib" path="web/WEB-INF/lib/log4j-1.2.8.jar"/> 
    7680    <classpathentry kind="lib" path="web/WEB-INF/lib/lucene-1.4.1.jar"/> 
    77     <classpathentry kind="lib" path="web/WEB-INF/lib/LuceneWrapper3.jar"/> 
     81    <classpathentry kind="lib" path="web/WEB-INF/lib/LuceneWrapper4.jar"/> 
    7882    <classpathentry kind="lib" path="web/WEB-INF/lib/mail.jar"/> 
    7983    <classpathentry kind="lib" path="web/WEB-INF/lib/maxent-2.4.0.jar"/> 
  • main/trunk/greenstone3/build.xml

    r28952 r29143  
    21952195    </if> 
    21962196 
    2197     <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${web.lib}"/>     
     2197    <copy file="${lucene.home}/LuceneWrapper4.jar" todir="${web.lib}"/>     
    21982198  </target> 
    21992199   
     
    24012401    <!-- LuceneWrapper jar file not installed by default --> 
    24022402    <mkdir dir="${gs2build.home}/bin/java"/> 
    2403     <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${gs2build.home}/bin/java"/> 
     2403    <copy file="${lucene.home}/LuceneWrapper4.jar" todir="${gs2build.home}/bin/java"/> 
    24042404 
    24052405  </target> 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java

    r28966 r29143  
    2929 
    3030import org.apache.log4j.Logger; 
    31 import org.greenstone.LuceneWrapper3.GS2LuceneQuery; 
    32 import org.greenstone.LuceneWrapper3.LuceneQueryResult; 
     31import org.greenstone.LuceneWrapper4.GS2LuceneQuery; 
     32import org.greenstone.LuceneWrapper4.LuceneQueryResult; 
    3333import org.greenstone.gsdl3.util.FacetWrapper; 
    3434import org.greenstone.gsdl3.util.GSFile; 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/LuceneSearch.java

    r28966 r29143  
    88 
    99import org.apache.log4j.Logger; 
     10import org.apache.lucene.index.DirectoryReader; 
    1011import org.apache.lucene.index.IndexReader; 
    1112import org.apache.lucene.index.Term; 
     
    173174            index_dir += File.separator + index; 
    174175            Directory index_dir_dir = FSDirectory.open(new File(index_dir)); 
    175             IndexSearcher searcher = new IndexSearcher(index_dir_dir); 
     176            IndexReader reader = DirectoryReader.open(index_dir_dir); //deprecated: IndexReader.open(index_dir_dir); 
     177            IndexSearcher searcher = new IndexSearcher(reader); 
    176178 
    177179            Term term = new Term("content", query_string); 
     
    182184 
    183185            GSXML.addMetadata(metadata_list, "numDocsMatched", "" + hits.scoreDocs.length); 
    184  
    185             IndexReader reader = searcher.getIndexReader(); 
    186186 
    187187            for (int i = 0; i < hits.scoreDocs.length; i++) 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/SharedSoleneGS2FieldSearch.java

    r28966 r29143  
    2323 
    2424import org.apache.log4j.Logger; 
    25 import org.greenstone.LuceneWrapper3.SharedSoleneQuery; 
     25import org.greenstone.LuceneWrapper4.SharedSoleneQuery; 
    2626import org.greenstone.gsdl3.util.GSXML; 
    2727import org.greenstone.gsdl3.util.XMLConverter;