You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Parisa <pa...@gmail.com> on 2009/01/13 11:42:59 UTC

solrj delete by Id problem

I have a problem with solrj delete By Id . If I search a keyword and it has
more than 1 result no (for example 7) then I delete on of the resulted doc
with solrj (server.deleteById  ) , I search this keyword again  the result
no is zero . and it 's not correct because it should be 6 . It should shows
the other 6 docs.


I should mention that when I restart the server  the result will be correct
and it shows the correct result no (I mean 6 docs).

besides, It has the problem with the keywords that we have searched before
deleting the docs and it has not problem with new key words.

-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21433056.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Jan 26, 2009 at 12:20 PM, Parisa <pa...@gmail.com> wrote:

>
> Is there any solution for fixing this bug ?
> --
> View this message in context:
> http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21661131.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
I don't think it is a bug because it works for the rest of us :)

deleteById works for deletion by the unique key's value. Can you check if
you are trying with deleting through some other field's value?

-- 
Regards,
Shalin Shekhar Mangar.

Re: solrj delete by Id problem

Posted by Parisa <pa...@gmail.com>.
I know that I can see the search result after the commit and it is ok, 

I can disable the queryResultCache and the problem will be fixed . but I
need the queryResultCache because my index Size is big and I need good
performance .

so I am trying to find how to fix the bug  or may be the solr guys fix it,

let me describe the issue again : when we search on keyword like
content:testSolr  the result number is 9 
(I mean there are 9 docs with testSolr in their Content) when I delete one
of this doc with solrJ api (delete with deleteById  and commit(false,false)) 
.

now when I search the content:testSolr  again the result number is zero  ,I
mean the result set is empty.
and it is not correct because it should be 8 it should shows the rest of the
docs .

if we restart the solr server then search again now the result number is ok
and it is 8 and it shows the rest of the docs.




 
-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21704110.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Jan 28, 2009 at 4:29 PM, Parisa <pa...@gmail.com> wrote:

>
> I should say that we also have this problem when we commit with waitflush =
> true and waitsearcher = true
>
> because   it again close the old searcher and open a new one. so it has
> warming up process with the queryResultCache.
>
> besides , I need to commit waitFlush = false and waitSearcher=false to see
> the search result immediately after delete.
>

Any change to the index is visible to queries only after the commit
completes and the new searcher is registered. Therefore, using
waitFlush=false and waitSearcher=false will not let you see the new results
immediately. If you do not want warming, you can disable it, however you
should test with your index and be aware of the performance impact of using
a cold searcher.

--
> View this message in context:
> http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21703654.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: solrj delete by Id problem

Posted by Parisa <pa...@gmail.com>.
I should say that we also have this problem when we commit with waitflush =
true and waitsearcher = true 

because   it again close the old searcher and open a new one. so it has
warming up process with the queryResultCache.
 
besides , I need to commit waitFlush = false and waitSearcher=false to see
the search result immediately after delete.






-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21703654.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Tue, Jan 27, 2009 at 8:51 PM, Parisa <pa...@gmail.com> wrote:

>
> I found how the issue is created .when solr warm up the new searcher with
> cacheLists , if the queryResultCache is enable the issue is created.
>
> notice:as I mentioned before I commit with waitflush=false and
> waitsearcher=false
>
> so it has problem in case the queryResultCache is on,
>

Ah so that is the issue. The problem is that when you call commit with
waitSearcher=false and waitFlush=false, the call immediately returns without
waiting for the commit to complete and the new searcher to be registered.
Therefore any queries you make until autowarming completes does not give you
the results from the new index.

You should call commit with both waitSearcher and waitFlush as true. That
should solve the problem.

-- 
Regards,
Shalin Shekhar Mangar.

Re: solrj delete by Id problem

Posted by Parisa <pa...@gmail.com>.
I found how the issue is created .when solr warm up the new searcher with
cacheLists , if the queryResultCache is enable the issue is created.

notice:as I mentioned before I commit with waitflush=false and
waitsearcher=false

so it has problem in case the queryResultCache is on,

but I don't know why the issue is created only in deleteById mode and we
don't have problem when we add a doc and commit with waitflush=false and
waitsearcher=false

I think they both use the same method for warmup the new searcher !!!

there is also a comment on solrCore class  that I am concern about it:

solrCore.java

public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean
returnSearcher, final Future[] waitSearcher) throws IOException {


------------------
----------------
----------------
 line 1132 (nightly version)

  // warm the new searcher based on the current searcher.
      // should this go before the other event handlers or after?

 
      if (currSearcher != null) {
        future = searcherExecutor.submit(
                new Callable() {
                  public Object call() throws Exception {
                    try {
                      newSearcher.warm(currSearcher);
                    } catch (Throwable e) {
                      SolrException.logOnce(log,null,e);
                    }
                    return null;
                  }
                }
        );
      }

-----
------

} 
-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21687431.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Parisa <pa...@gmail.com>.
Is there any solution for fixing this bug ?
-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21661131.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Parisa <pa...@gmail.com>.

Shalin Shekhar Mangar wrote:
> 
> Did you call commit after the delete?
> 
> Ofcourse I call commit and I test both commit(false,false) and
> commit(true,true) in both cases the result is the same. 
> 
> On Tue, Jan 13, 2009 at 4:12 PM, Parisa <pa...@gmail.com> wrote:
> 
>>
>> I have a problem with solrj delete By Id . If I search a keyword and it
>> has
>> more than 1 result no (for example 7) then I delete on of the resulted
>> doc
>> with solrj (server.deleteById  ) , I search this keyword again  the
>> result
>> no is zero . and it 's not correct because it should be 6 . It should
>> shows
>> the other 6 docs.
>>
>>
>> I should mention that when I restart the server  the result will be
>> correct
>> and it shows the correct result no (I mean 6 docs).
>>
>> besides, It has the problem with the keywords that we have searched
>> before
>> deleting the docs and it has not problem with new key words.
>>
>> --
>> View this message in context:
>> http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21433056.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21435839.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solrj delete by Id problem

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Did you call commit after the delete?

On Tue, Jan 13, 2009 at 4:12 PM, Parisa <pa...@gmail.com> wrote:

>
> I have a problem with solrj delete By Id . If I search a keyword and it has
> more than 1 result no (for example 7) then I delete on of the resulted doc
> with solrj (server.deleteById  ) , I search this keyword again  the result
> no is zero . and it 's not correct because it should be 6 . It should shows
> the other 6 docs.
>
>
> I should mention that when I restart the server  the result will be correct
> and it shows the correct result no (I mean 6 docs).
>
> besides, It has the problem with the keywords that we have searched before
> deleting the docs and it has not problem with new key words.
>
> --
> View this message in context:
> http://www.nabble.com/solrj-delete-by-Id-problem-tp21433056p21433056.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.