Examples of IndexException


Examples of org.apache.tuscany.sca.domain.search.IndexException

                        // ignore exception
                    }

                }

                throw new IndexException(e.getMessage(), e);

            } finally {

                if (indexWriter != null) {
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.IndexException

        } catch (ParseException e) {
            // ignore exception

        } catch (CorruptIndexException ex) {
            throw new IndexException(ex.getMessage(), ex);

        } catch (IOException ex) {
            throw new IndexException(ex.getMessage(), ex);
        }

    }
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.IndexException

           
            try {
                indexWriter.addDocument(luceneDoc);
               
            } catch (CorruptIndexException e) {
                throw new IndexException(e.getMessage(), e);
               
            } catch (IOException e) {
                throw new IndexException(e.getMessage(), e);
            }
           
        }
        // writer.close();
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.IndexException

                    // ignore exception
                }

            }

            throw new IndexException(e.getMessage(), e);

        } finally {

            if (indexWriter != null) {
View Full Code Here

Examples of org.apache.tuscany.sca.domain.search.IndexException

            }

            return results;

        } catch (CorruptIndexException ex) {
            throw new IndexException(ex.getMessage(), ex);

        } catch (IOException ex) {
            throw new IndexException(ex.getMessage(), ex);
        }

    }
View Full Code Here

Examples of org.dbpedia.spotlight.exceptions.IndexException

    public void add(SurfaceForm surfaceForm, DBpediaResource resource) throws IndexException {
        Document newDoc = mLucene.createDocument(surfaceForm, resource);
        try {
            mWriter.addDocument(newDoc); // do not commit for faster indexing.
        } catch (IOException e) {
            throw new IndexException("Error adding candidate map to the index. ", e);
        }

        LOG.trace("Added to " + mLucene.directory().toString() + ": " + surfaceForm.toString() + " -> " + resource.toString());
    }
View Full Code Here

Examples of org.dbpedia.spotlight.exceptions.IndexException

            newDoc.add(mLucene.getField(surfaceForms.get(i)));
        }
        try {
            mWriter.addDocument(newDoc); // do not commit for faster indexing.
        } catch (IOException e) {
            throw new IndexException("Error adding candidate map to the index. ", e);
        }

        LOG.trace("Added to " + mLucene.directory().toString() + ": " + surfaceForms.toString() + " -> " + resource.toString());
    }
View Full Code Here

Examples of org.dbpedia.spotlight.exceptions.IndexException

    public void add(SurfaceForm surfaceForm, DBpediaResource resource, int nTimes) throws IndexException {
        Document newDoc = mLucene.createDocument(surfaceForm, resource, nTimes);
        try {
            mWriter.addDocument(newDoc); //TODO ATTENTION need to merge with existing doc if URI is already in index
        } catch (IOException e) {
            throw new IndexException("Error adding candidate map to the index. ", e);
        }

        LOG.trace("Added to " + mLucene.directory().toString() + ": " + surfaceForm.toString() + " -> " + resource.toString());
    }
View Full Code Here

Examples of org.dbpedia.spotlight.exceptions.IndexException

            try {
                LOG.info("Now committing...");
                mWriter.commit();
                LOG.info("Commit done.");
            } catch (Exception e) {
                throw new IndexException("Error running commit.",e);
            }

            /*
            Since Lucene 2.9 you don’t need to optimize in most cases, as search is working per-segment.
            Optimizing an index should only be done during maintenance or if you want to ship a static index e.g. on a DVD.
View Full Code Here

Examples of org.dbpedia.spotlight.exceptions.IndexException

            LOG.info(String.format("Merge done (%s) resources merged).",percent));
            numMerges++;

            searcher.close();
        } catch (IOException e) {
            throw new IndexException(e);
        } catch (SearchException e) {
            throw new IndexException(e);
        }
    }
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.