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 Claudio Devecchi <cd...@gmail.com> on 2010/10/11 22:01:28 UTC

Deleting Documents with null fields by query

Hi everybody,

I'm trying to delete by query some documents with null content (this
happened because I crawled my intranet and somethings came null)

When I try this works fine (I'm deleting from my solr index every document
that dont have wiki on the field content)
curl http://localhost:8983/solr/update?commit=true -H 'Content-Type:
text/xml' --data-binary '<delete><query>*:* AND
-content:wiki<query></delete>'

Now I need to make a query that delete every document that have the field
content null.

Somebody could help me pls?

Tks
CLaudio

Re: Deleting Documents with null fields by query

Posted by Erick Erickson <er...@gmail.com>.
"erase all the content". Oops.

first, I should look more carefully. You don't want the AND in there, use
<delete><query>*:* -content:[* TO *]<query></delete>

In general, don't mix and match booleans and native Lucene query syntax...

Before sending this to Solr, what do you get back when you try just the
query
in, say, the admin page? I'd be testing the query there before actually
submitting
the delete....

Best
Erick

On Mon, Oct 11, 2010 at 4:33 PM, Claudio Devecchi <cd...@gmail.com>wrote:

> yes..
>
> dont work, doing it I erase all the content. :(
>
> or, another thing that will help me is to make a query that doesnt bring
> the
> null one.
>
> tks
>
> On Mon, Oct 11, 2010 at 5:27 PM, Erick Erickson <erickerickson@gmail.com
> >wrote:
>
> > Have you tried something like:
> >
> > '<delete><query>*:* AND
> > -content:[* TO *]<query></delete>
> >
> >
> > On Mon, Oct 11, 2010 at 4:01 PM, Claudio Devecchi <cdevecchi@gmail.com
> > >wrote:
> >
> > > Hi everybody,
> > >
> > > I'm trying to delete by query some documents with null content (this
> > > happened because I crawled my intranet and somethings came null)
> > >
> > > When I try this works fine (I'm deleting from my solr index every
> > document
> > > that dont have wiki on the field content)
> > > curl http://localhost:8983/solr/update?commit=true -H 'Content-Type:
> > > text/xml' --data-binary '<delete><query>*:* AND
> > > -content:wiki<query></delete>'
> > >
> > > Now I need to make a query that delete every document that have the
> field
> > > content null.
> > >
> > > Somebody could help me pls?
> > >
> > > Tks
> > > CLaudio
> > >
> >
>
>
>
> --
> Claudio Devecchi
> flickr.com/cdevecchi
>

Re: Deleting Documents with null fields by query

Posted by Claudio Devecchi <cd...@gmail.com>.
yes..

dont work, doing it I erase all the content. :(

or, another thing that will help me is to make a query that doesnt bring the
null one.

tks

On Mon, Oct 11, 2010 at 5:27 PM, Erick Erickson <er...@gmail.com>wrote:

> Have you tried something like:
>
> '<delete><query>*:* AND
> -content:[* TO *]<query></delete>
>
>
> On Mon, Oct 11, 2010 at 4:01 PM, Claudio Devecchi <cdevecchi@gmail.com
> >wrote:
>
> > Hi everybody,
> >
> > I'm trying to delete by query some documents with null content (this
> > happened because I crawled my intranet and somethings came null)
> >
> > When I try this works fine (I'm deleting from my solr index every
> document
> > that dont have wiki on the field content)
> > curl http://localhost:8983/solr/update?commit=true -H 'Content-Type:
> > text/xml' --data-binary '<delete><query>*:* AND
> > -content:wiki<query></delete>'
> >
> > Now I need to make a query that delete every document that have the field
> > content null.
> >
> > Somebody could help me pls?
> >
> > Tks
> > CLaudio
> >
>



-- 
Claudio Devecchi
flickr.com/cdevecchi

Re: Deleting Documents with null fields by query

Posted by Erick Erickson <er...@gmail.com>.
Have you tried something like:

'<delete><query>*:* AND
-content:[* TO *]<query></delete>


On Mon, Oct 11, 2010 at 4:01 PM, Claudio Devecchi <cd...@gmail.com>wrote:

> Hi everybody,
>
> I'm trying to delete by query some documents with null content (this
> happened because I crawled my intranet and somethings came null)
>
> When I try this works fine (I'm deleting from my solr index every document
> that dont have wiki on the field content)
> curl http://localhost:8983/solr/update?commit=true -H 'Content-Type:
> text/xml' --data-binary '<delete><query>*:* AND
> -content:wiki<query></delete>'
>
> Now I need to make a query that delete every document that have the field
> content null.
>
> Somebody could help me pls?
>
> Tks
> CLaudio
>