Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8347

Asynchronous searcher for custom component

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      I'm trying to write a custom component for fuzzy searches.
      After solr calls my component, I create a Thread and give it the SolrIndexSearcher and some params.

      Problem is after a few seconds I get an Exception that the indexreader was closed

      org.apache.lucene.store.AlreadyClosedException: this IndexReader cannot be used anymore as one of its child readers was closed
              at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:279)
              at org.apache.lucene.index.FilterLeafReader.getLiveDocs(FilterLeafReader.java:374)
              at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:768)
              at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:485)
              at org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:202)
              at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1666)
              at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1485)
              at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:561)
              at org.apache.solr.search.SolrIndexSearcher.getDocList(SolrIndexSearcher.java:1350)
              at awinta.mdm.solr.components.FuzzyLikeThisComponent$FLTHelper.getLikeThis(FuzzyLikeThisComponent.java:336)
              at awinta.mdm.solr.components.FLTWorker.getLikeThese(FLTWorker.java:161)
              at awinta.mdm.solr.components.FLTWorker.call(FLTWorker.java:94)
              at awinta.mdm.solr.components.FLTWorker.call(FLTWorker.java:35)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      
      

      Is there a way of locking the IndexReader so it doesn't get closed by other threads?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bogandy Bogdan Marinescu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: