Examples of CJKAnalyzer


Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

            // create index.
            Analyzer luceneAnalyzer = new StandardAnalyzer(Version.LUCENE_30);
            indexWriter = new IndexWriter(indexDir, luceneAnalyzer, new IndexWriter.MaxFieldLength(1024*1024));
            indexReader = indexWriter.getReader();
            indexSearcher = new IndexSearcher(indexReader);
            analyzer = new CJKAnalyzer(Version.LUCENE_30);
        } catch (IOException e) {
            Logger.error("LuceneService cannot be initialized", e);
            indexWriter = null;
            indexReader = null;
            indexSearcher = null;
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

        }

        private static String[] queryImpl(String aLanguageStr, String aIndexStr, String aQueryStr, boolean bCaptionOnly) throws Exception {
            IndexReader reader = IndexReader.open(aIndexStr);
            Searcher searcher = new IndexSearcher(reader);
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();

            String aField;
            if (bCaptionOnly) {
                aField = "caption";
            } else {
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

        File aCaptionFilesDir = new File(aDirToZipStr + File.separator + "caption");
        File aContentFilesDir = new File(aDirToZipStr + File.separator + "content");

        try {
            Date start = new Date();
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
            IndexWriter writer = new IndexWriter(aIndexDir, analyzer, true);
            System.out.println("Lucene: Indexing to directory '" + aIndexDir + "'...");
            int nRet = indexDocs(writer, aModule, aCaptionFilesDir, aContentFilesDir);
            if (nRet != -1) {
                System.out.println();
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

    @Inject public CjkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
        super(index, indexSettings, name, settings);
        Set<?> stopWords = Analysis.parseStopWords(env, settings, CJKAnalyzer.getDefaultStopSet());

        analyzer = new CJKAnalyzer(version, stopWords);
    }
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

    private static String[] queryImpl( String aLanguageStr, String aIndexStr, String aQueryStr,
      boolean bCaptionOnly, Object[] aScoreOutArray ) throws Exception
    {
      IndexReader reader = IndexReader.open( aIndexStr );
      Searcher searcher = new IndexSearcher( reader );
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();

      String aField;
      if( bCaptionOnly )
        aField = "caption";
      else
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

        File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" );
   
        try
    {
            Date start = new Date();
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
            IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true );
      if( !bExtensionMode )
              System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." );
            int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir );
            if( nRet != -1 )
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

      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);

      String aField;
      if( bCaptionOnly )
        aField = "caption";
      else
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

    private static String[] queryImpl( String aLanguageStr, String aIndexStr, String aQueryStr,
      boolean bCaptionOnly, Object[] aScoreOutArray ) throws Exception
    {
      IndexReader reader = IndexReader.open( aIndexStr );
      Searcher searcher = new IndexSearcher( reader );
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();

      String aField;
      if( bCaptionOnly )
        aField = "caption";
      else
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

        File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" );
   
        try
    {
            Date start = new Date();
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
            IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true );
      if( !bExtensionMode )
              System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." );
            int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir );
            if( nRet != -1 )
View Full Code Here

Examples of org.apache.lucene.analysis.cjk.CJKAnalyzer

        File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" );
   
        try
    {
            Date start = new Date();
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer();
            IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true );
      if( !bExtensionMode )
              System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." );
            int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir );
            if( nRet != -1 )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.