@Override public boolean hasNext() { boolean hasNext = ontologyIterator.hasNext(); if (hasNext) { next = ontologyIterator.next(); if (documentFilter != null && !documentFilter.accept(next)) { return hasNext(); } } return hasNext; }
@Override public boolean hasNext() { boolean hasNext = ontologyIterator.hasNext(); if (hasNext) { next = ontologyIterator.next(); if (documentFilter != null && !documentFilter.accept(next)) { return hasNext(); } } return hasNext; }
public void index(OntologyDocument ontologyDocument, DocumentFilter documentFilter) throws IntactSolrException { if (documentFilter != null && !documentFilter.accept(ontologyDocument)) { return; } SolrInputDocument doc = createSolrInputDocument(ontologyDocument); try { solrServer.add(doc); } catch (Exception e) { throw new IntactSolrException("Problem adding ontology document to SOLR server: "+ontologyDocument, e); } }
public void index(OntologyDocument ontologyDocument, DocumentFilter documentFilter) throws IntactSolrException { if (documentFilter != null && !documentFilter.accept(ontologyDocument)) { return; } SolrInputDocument doc = createSolrInputDocument(ontologyDocument); try { solrServer.add(doc); } catch (Exception e) { int numberOfTries = 1; boolean isSuccessful = false; while (numberOfTries <= this.numberOfTries && !isSuccessful){ try { solrServer.add(doc); isSuccessful = true; } catch (Exception e2) { numberOfTries++; } } if (!isSuccessful){ throw new IntactSolrException("Problem adding ontology document to SOLR server: "+ontologyDocument, e); } } }