Examples of LuceneDictionary


Examples of org.apache.lucene.search.spell.LuceneDictionary

                              {
                                 IndexReader reader = handler.getIndexReader();
                                 try
                                 {
                                    long time = System.currentTimeMillis();
                                    Dictionary dict = new LuceneDictionary(reader, FieldNames.FULLTEXT);
                                    LOG.debug("Starting spell checker index refresh");
                                    spellChecker.indexDictionary(dict, new IndexWriterConfig(Version.LUCENE_36,
                                       new StandardAnalyzer(Version.LUCENE_36)), true);
                                    time = System.currentTimeMillis() - time;
                                    time = time / 1000;
View Full Code Here

Examples of org.apache.lucene.search.spell.LuceneDictionary

      throw new SolrException
        (SolrException.ErrorCode.SERVER_ERROR, "can't rebuild spellchecker index without termSourceField configured");
    }
     
    IndexReader indexReader = req.getSearcher().getReader();
    Dictionary dictionary = new LuceneDictionary(indexReader, termSourceField);
    spellChecker.clearIndex();
    spellChecker.indexDictionary(dictionary);
    reopen();
  }
View Full Code Here

Examples of org.apache.lucene.search.spell.LuceneDictionary

        try {
            log.info("Generating spelling suggestion index ... ");
            indexReader = IndexReader.open(indexDirectory);
            checker = new SpellChecker(spellDirectory);
            //TODO below seems only to index "defs" , possible bug ?
            checker.indexDictionary(new LuceneDictionary(indexReader, "defs"), new IndexWriterConfig(Version.LUCENE_36, null), true);
            log.info("done");
        } catch (IOException e) {
            log.log(Level.SEVERE, "ERROR: Generating spelling: {0}", e);
        } finally {
            if (indexReader != null) {
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.