Note that there are some explanatory texts on larger screens.

plurals
  1. POSolrJ keeps indexed files open
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/4984306/solrj-addfile-keeps-documents-open">SolrJ addFile keeps documents open</a> </p> </blockquote> <p>Hey guys,</p> <p>I'm quite new to Apache Solr. My situation is the following:</p> <p>When my application starts up, it scans a directory and adds all pdf-Files in that directory to the Solr Index (Using SolrJ's ContentStreamUpdateRequest):</p> <p>However, the application also utilizes JNotify to watch over the folder, so that it can update Solr's index in case a file changes.</p> <p>The problem is the following: After the initial scan of the directory, everything is working fine, all file handles are removed after the respective files have been streamed to Solr. But if a change within the directory occurs (such as renaming a file), SolrJ just doesn't seem to let go of the changed file's handle, thus it can no longer be modified.</p> <p>What am I doing wrong here? (The snippet below is both used for the initial scan and when a file changes)</p> <pre><code>protected 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 = solr.request( csur ); return result != null; } </code></pre> <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.
    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