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 Dixline <di...@gmail.com> on 2012/12/18 07:03:34 UTC

Delete by Query not working properly

Hi,

I've deleted a document using http://localhost:8983/solr/update?stream.body=
<delete><query>skills_s:Perl</query></delete> and the committed the delete
also. Again if search using q=perl i'm able to see the same document but if
i search using q=skills_s:Perl it is not returning any results. Can someone
explain is this how delete by query works?

Thanks,
Dixline.M



--
View this message in context: http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Delete by Query not working properly

Posted by Jack Krupansky <ja...@basetechnology.com>.
Oh, and since the field name suggests that the field type is "string", be 
sure that you have the case exact - string fields are case sensitive.

So, change:

    <delete><query>skills_s:Perl</query></delete>

to

    <delete><query>skills_s:perl</query></delete>

-- Jack Krupansky

-----Original Message----- 
From: Jack Krupansky
Sent: Tuesday, December 18, 2012 9:03 AM
To: solr-user@lucene.apache.org
Subject: Re: Delete by Query not working properly

Make sure that your curl command includes:

  -H "Content-Type: text/xml"

For example,

curl http://localhost:8983/solr/update?commit=true -H "Content-Type:
text/xml" --data-binary '
<delete><query>id:doc-2012-12-18</query></delete>'

-- Jack Krupansky

-----Original Message----- 
From: Dixline
Sent: Tuesday, December 18, 2012 1:03 AM
To: solr-user@lucene.apache.org
Subject: Delete by Query not working properly

Hi,

I've deleted a document using http://localhost:8983/solr/update?stream.body=
<delete><query>skills_s:Perl</query></delete> and the committed the delete
also. Again if search using q=perl i'm able to see the same document but if
i search using q=skills_s:Perl it is not returning any results. Can someone
explain is this how delete by query works?

Thanks,
Dixline.M



--
View this message in context:
http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
Sent from the Solr - User mailing list archive at Nabble.com. 


Re: Delete by Query not working properly

Posted by Jack Krupansky <ja...@basetechnology.com>.
Yes, text/xml is deprecated. But it is less typing for curl commands!

Why Solr doesn't default to application/xml is a mystery.

-- Jack Krupansky

-----Original Message----- 
From: Walter Underwood
Sent: Tuesday, December 18, 2012 10:47 AM
To: solr-user@lucene.apache.org
Subject: Re: Delete by Query not working properly

Never use text/xml, always application/xml.

wunder

On Dec 18, 2012, at 6:03 AM, Jack Krupansky wrote:

> Make sure that your curl command includes:
>
> -H "Content-Type: text/xml"
>
> For example,
>
> curl http://localhost:8983/solr/update?commit=true -H "Content-Type: 
> text/xml" --data-binary '
> <delete><query>id:doc-2012-12-18</query></delete>'
>
> -- Jack Krupansky
>
> -----Original Message----- From: Dixline
> Sent: Tuesday, December 18, 2012 1:03 AM
> To: solr-user@lucene.apache.org
> Subject: Delete by Query not working properly
>
> Hi,
>
> I've deleted a document using 
> http://localhost:8983/solr/update?stream.body=
> <delete><query>skills_s:Perl</query></delete> and the committed the delete
> also. Again if search using q=perl i'm able to see the same document but 
> if
> i search using q=skills_s:Perl it is not returning any results. Can 
> someone
> explain is this how delete by query works?
>
> Thanks,
> Dixline.M
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
> Sent from the Solr - User mailing list archive at Nabble.com.

--
Walter Underwood
wunder@wunderwood.org




Re: Delete by Query not working properly

Posted by Walter Underwood <wu...@wunderwood.org>.
Never use text/xml, always application/xml.

wunder

On Dec 18, 2012, at 6:03 AM, Jack Krupansky wrote:

> Make sure that your curl command includes:
> 
> -H "Content-Type: text/xml"
> 
> For example,
> 
> curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '
> <delete><query>id:doc-2012-12-18</query></delete>'
> 
> -- Jack Krupansky
> 
> -----Original Message----- From: Dixline
> Sent: Tuesday, December 18, 2012 1:03 AM
> To: solr-user@lucene.apache.org
> Subject: Delete by Query not working properly
> 
> Hi,
> 
> I've deleted a document using http://localhost:8983/solr/update?stream.body=
> <delete><query>skills_s:Perl</query></delete> and the committed the delete
> also. Again if search using q=perl i'm able to see the same document but if
> i search using q=skills_s:Perl it is not returning any results. Can someone
> explain is this how delete by query works?
> 
> Thanks,
> Dixline.M
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
> Sent from the Solr - User mailing list archive at Nabble.com. 

--
Walter Underwood
wunder@wunderwood.org




Re: Delete by Query not working properly

Posted by Jack Krupansky <ja...@basetechnology.com>.
Make sure that your curl command includes:

  -H "Content-Type: text/xml"

For example,

curl http://localhost:8983/solr/update?commit=true -H "Content-Type: 
text/xml" --data-binary '
<delete><query>id:doc-2012-12-18</query></delete>'

-- Jack Krupansky

-----Original Message----- 
From: Dixline
Sent: Tuesday, December 18, 2012 1:03 AM
To: solr-user@lucene.apache.org
Subject: Delete by Query not working properly

Hi,

I've deleted a document using http://localhost:8983/solr/update?stream.body=
<delete><query>skills_s:Perl</query></delete> and the committed the delete
also. Again if search using q=perl i'm able to see the same document but if
i search using q=skills_s:Perl it is not returning any results. Can someone
explain is this how delete by query works?

Thanks,
Dixline.M



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
Sent from the Solr - User mailing list archive at Nabble.com. 


Re: Delete by Query not working properly

Posted by Upayavira <uv...@odoko.co.uk>.
Surely you are deleting documents that have the term Perl in the
skills_s field, but are leaving behind another document that has Perl in
the default field (usually 'text'). Before doing the delete, do 'q=Perl
skills_s:Perl' and see if you get more than one document.

That's what it looks like anyhow.

Upayavira

On Tue, Dec 18, 2012, at 06:03 AM, Dixline wrote:
> Hi,
> 
> I've deleted a document using
> http://localhost:8983/solr/update?stream.body=
> <delete><query>skills_s:Perl</query></delete> and the committed the
> delete
> also. Again if search using q=perl i'm able to see the same document but
> if
> i search using q=skills_s:Perl it is not returning any results. Can
> someone
> explain is this how delete by query works?
> 
> Thanks,
> Dixline.M
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Delete-by-Query-not-working-properly-tp4027681.html
> Sent from the Solr - User mailing list archive at Nabble.com.