Ah, ok. That makes sense. I wonder if your use-case would be better served, 
though, by “in place updates”, see: 
https://lucene.apache.org/solr/guide/8_1/updating-parts-of-documents.html This 
has been around in since Solr 6.5…

Best,
Erick

> On Aug 10, 2020, at 8:24 AM, Akshay Murarka <aks...@saavn.com> wrote:
> 
> Hey,
> 
> So I have external file fields that have some data that get updated
> regularly. Whenever those get updated we need the open searcher operation
> to happen. The value in this external files are used in boosting and other
> function/range queries.
> 
> On Mon, Aug 10, 2020 at 5:08 PM Erick Erickson <erickerick...@gmail.com>
> wrote:
> 
>> In a word, “no”. There is explicit code to _not_ open a new searcher if
>> the index hasn’t changed because it’s an expensive operation.
>> 
>> Could you explain _why_ you want to open a new searcher even though the
>> index is unchanged? The reason for the check in the first place is that
>> nothing has changed about the index so the assumption is that there’s no
>> reason to open a new searcher.
>> 
>> You could add at least one bogus doc on each shard, then delete them all
>> then issue a commit as a rather crude way to do this. Insuring that you
>> changed at least one doc on each shard is “an exercise for the reader”…
>> 
>> Again, though, perhaps if you explained why you think this is necessary we
>> could suggest another approach. At first glance, this looks like an XY
>> problem though.
>> 
>> Best,
>> Erick
>> 
>>> On Aug 10, 2020, at 5:49 AM, Akshay Murarka <aks...@saavn.com> wrote:
>>> 
>>> Hey,
>>> 
>>> I have a use case where none of the document in my solr index is
>> changing but I still want to open a new searcher through the curl api.
>>> On executing the below curl command
>>> curl
>> “XXX.XX.XX.XXX:9744/solr/mycollection/update?openSearcher=true&commit=true”
>>> it doesn’t open a new searcher. Below is what I get in logs
>>> 
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6824) [c:mycollection
>> s:shard1_1_0 r:core_node6 x:mycollection_shard1_1_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 start
>> commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6819) [c:mycollection
>> s:shard1_0_1 r:core_node5 x:mycollection_shard1_0_1_replica1]
>> o.a.s.u.DirectUpdateHandler2 start
>> commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6829) [c:mycollection
>> s:shard1_0_0 r:core_node4 x:mycollection_shard1_0_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 start
>> commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6824) [c:mycollection
>> s:shard1_1_0 r:core_node6 x:mycollection_shard1_1_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 No uncommitted changes. Skipping IW.commit.
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6819) [c:mycollection
>> s:shard1_0_1 r:core_node5 x:mycollection_shard1_0_1_replica1]
>> o.a.s.u.DirectUpdateHandler2 No uncommitted changes. Skipping IW.commit.
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6766) [c:mycollection
>> s:shard1_1_1 r:core_node7 x:mycollection_shard1_1_1_replica1]
>> o.a.s.u.DirectUpdateHandler2 start
>> commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6829) [c:mycollection
>> s:shard1_0_0 r:core_node4 x:mycollection_shard1_0_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 No uncommitted changes. Skipping IW.commit.
>>> 2020-08-10 09:32:22.696 INFO  (qtp297786644-6766) [c:mycollection
>> s:shard1_1_1 r:core_node7 x:mycollection_shard1_1_1_replica1]
>> o.a.s.u.DirectUpdateHandler2 No uncommitted changes. Skipping IW.commit.
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6824) [c:mycollection
>> s:shard1_1_0 r:core_node6 x:mycollection_shard1_1_0_replica1]
>> o.a.s.c.SolrCore SolrIndexSearcher has not changed - not re-opening:
>> org.apache.solr.search.SolrIndexSearcher
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6819) [c:mycollection
>> s:shard1_0_1 r:core_node5 x:mycollection_shard1_0_1_replica1]
>> o.a.s.c.SolrCore SolrIndexSearcher has not changed - not re-opening:
>> org.apache.solr.search.SolrIndexSearcher
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6829) [c:mycollection
>> s:shard1_0_0 r:core_node4 x:mycollection_shard1_0_0_replica1]
>> o.a.s.c.SolrCore SolrIndexSearcher has not changed - not re-opening:
>> org.apache.solr.search.SolrIndexSearcher
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6824) [c:mycollection
>> s:shard1_1_0 r:core_node6 x:mycollection_shard1_1_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 end_commit_flush
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6819) [c:mycollection
>> s:shard1_0_1 r:core_node5 x:mycollection_shard1_0_1_replica1]
>> o.a.s.u.DirectUpdateHandler2 end_commit_flush
>>> 2020-08-10 09:32:22.697 INFO  (qtp297786644-6829) [c:mycollection
>> s:shard1_0_0 r:core_node4 x:mycollection_shard1_0_0_replica1]
>> o.a.s.u.DirectUpdateHandler2 end_commit_flush
>>> 
>>> 
>>> I don’t want to do a complete reload of my collection.
>>> Is there any parameter that can be used to forcefully open a new
>> searcher every time I do a commit with openSearcher=true
>>> 
>>> Thanks in advance for the help
>>> 
>> 
>> 

Reply via email to