Index Update for SOLR

Source: Internet
Author: User
Tags solr
Background: SOLR as a search tool, indexed by the traditional Lucene build, when updating the index file, the search does not appear update SOLR did do a fine caching mechanism, the cache with a specific searcher binding, compared to the normal cache,   SOLR's cache does not expire after a period of time, unless searcher changes when you integrate SOLR into your application rather than using the SOLR server approach, this can be a hassle, and you have to write your own code to solve By analyzing SOLR's readercycle scripts and Solrupdateservlet, you can easily find the answer code as follows: Legacyupdatehandler = new Xmlupdaterequesthandler ();
Legacyupdatehandler.init (NULL);
BufferedReader requestreader = new BufferedReader (new StringReader ("<commit/>"));
Legacyupdatehandler.update (Requestreader); When you follow the new index file and then call this code, you will find similar results 2008-4-1:28:12 Org.apache.solr.update.DirectUpdateHandler2 Commit
Info: Start commit (optimize = false, Waitflush = False, Waitsearcher = True)
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher <init>
Info: Opening SEARCHER@1474FC Main
2008-4-1:28:12 Org.apache.solr.update.DirectUpdateHandler2 Commit
Info: End_commit_flush
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming SEARCHER@1474FC main from searcher@c550 main
filtercache{lookups = 0, hits = 0, Hitratio = 0.00, inserts = 1, evictions = 0, size = 1, cumulative_lookups = 0, C umulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 1, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming result for SEARCHER@1474FC main
filtercache{lookups = 0, hits = 0, Hitratio = 0.00, inserts = 1, evictions = 0, size = 1, cumulative_lookups = 0, C umulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 1, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming SEARCHER@1474FC main from searcher@c550 main
queryresultcache{lookups = 1, hits = 0, Hitratio = 0.00, inserts = 1, evictions = 0, size = 1, cumulative_lookups = 1, cumulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 1, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming result for SEARCHER@1474FC main
queryresultcache{lookups = 0, hits = 0, Hitratio = 0.00, inserts = 1, evictions = 0, size = 1, cumulative_lookups = 1, cumulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 1, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming SEARCHER@1474FC main from searcher@c550 main
documentcache{lookups = 0, hits = 0, Hitratio = 0.00, inserts = 0, evictions = 0, size = 0, cumulative_lookups = 0, cumulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 0, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.search.SolrIndexSearcher Warm
Info: autowarming result for SEARCHER@1474FC main
documentcache{lookups = 0, hits = 0, Hitratio = 0.00, inserts = 0, evictions = 0, size = 0, cumulative_lookups = 0, cumulative_hits = 0, Cumulative_hitratio = 0.00, Cumulative_inserts = 0, cumulative_evictions = 0}
2008-4-1:28:12 Org.apache.solr.core.SolrCore Registersearcher
Info: Registered New Searcher SEARCHER@1474FC main
2008-4-1:28:12 Org.apache.solr.handler.XmlUpdateRequestHandler Update
Info: Commit 0 9
From the log, searcher really changed the new after you search again, the results are updated

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.