Note that there are some explanatory texts on larger screens.

plurals
  1. POSolrJ addFile keeps documents open
    primarykey
    data
    text
    <p>I've already submitted a similar question, but I've broken down the problem to its simplest form, so I'm gonna post it again:</p> <p>The problem is, that SolrJ seems to keep file handles open, if I add the same file more than once.</p> <p>I use the following method to submit a document to Solr:</p> <pre><code>public boolean addDocument( File doc ) throws IOException, SolrServerException { ContentStreamUpdateRequest csur = new ContentStreamUpdateRequest( "/update/extract" ); csur.addFile( doc ); csur.setParam( "literal.id", Utils.getAbsolutePath( doc ) ); csur.setAction( AbstractUpdateRequest.ACTION.COMMIT, true, true ); NamedList&lt;Object&gt; result = this.solr.request( csur ); return result != null; } </code></pre> <p>And this method to remove documents:</p> <pre><code>public void removeDocument( File doc ) throws IOException, SolrServerException { this.solr.deleteById( Utils.getAbsolutePath( doc ) ); this.solr.commit(); } </code></pre> <p>But that seems to leave some File Handles lingering:</p> <p>The following snippet demonstrates the problem:</p> <pre><code>File doc = new File( "../../testpdf/bbb.pdf" ); solr.addDocument( doc ); //solr.removeDocument( doc ); // Without these 2 lines, all handles //solr.addDocument( doc ); // are released correctly </code></pre> <p>If I add the same document twice, SolrJ somehow keeps the handles alive, and the added document cannot be modified by any other processes.</p> <p>I've already tried calling using <code>csur.addContentStream()</code> instead of <code>csur.addFile()</code> in <code>addDocument</code> and then closing the underlying Stream and Reader of the added stream, with no effect.</p> <p>thx for any suggestions in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload