lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tri Cao <tm...@me.com>
Subject Re: deleteDocument with NRT
Date Mon, 14 Jul 2014 15:19:29 GMT
Solr has the notion of "soft commit" and "hard commit". A soft commit
means Solr will reopen a new searcher. A hard commit means a flush to disk.
All the update/delete logics are in Lucene, Solr doesn't maintain deleted
doc IDs. It does maintain its own caches though.

On Jul 14, 2014, at 03:09 AM, Ganesh <emailgane@yahoo.co.in> wrote:


How Solr handles this scenario... Is it reopening reader after every 
delete OR it maintains the list of delete documents in cache?

Regards
Ganesh

On 7/11/2014 4:00 AM, Tri Cao wrote:
        > You need to reopen your searcher after deleting. From Java doc for 
        > SearcherManager:
        >
        > In addition you should periodically call maybeRefresh 
        > <eclipse-javadoc:%E2%98%82=lucene-solr/lucene%5C/core%5C/src%5C/java%3Corg.apache.lucene.search%7BSearcherManager.java%E2%98%83SearcherManager%E2%98%82%E2%98%82maybeRefresh
       >. 
        > While it's possible to call this just before running each query, this 
        > is discouraged since it penalizes the unlucky queries that do the 
        > reopen. It's better to use a separate background thread, that 
        > periodically calls maybeReopen. Finally, be sure to call close 
        > <eclipse-javadoc:%E2%98%82=lucene-solr/lucene%5C/core%5C/src%5C/java%3Corg.apache.lucene.search%7BSearcherManager.java%E2%98%83SearcherManager%E2%98%82%E2%98%82close
     > 
        > once you are done.
        >
        >
        >
        > On Jul 10, 2014, at 01:56 PM, Jamie <jamie@mailarchiva.com    > wrote:
        >
        >        > Hi
        >        >
        >        > I am using NRT search with the SearcherManager class. When
the user
        >        > elects to delete some documents, writer.deleteDocuments(terms)
is called.
        >        >
        >        > The problem is that deletes are not immediately visible.
What does it
        >        > take to make them so? Even after calling commit(), the deleted
        >        > documents are still returned.
        >        >
        >        > What is the recommended way to obtain a near realtime search
result that
        >        > immediately reflect all deleted documents?
        >        >
        >        > Much appreciate
        >        >
        >        > Jamie
        >        >
        >        >
        >        >
        >        >
        >        >
        >        > ---------------------------------------------------------------------
        >        > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org

        >        > <mailto:java-user-unsubscribe@lucene.apache.org  >
        >        > For additional commands, e-mail: java-user-help@lucene.apache.org

        >        > <mailto:java-user-help@lucene.apache.org        >
        >        >


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
    • Unnamed multipart/related (inline, None, 0 bytes)
View raw message