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 Daniel Baughman <da...@hostworks.com> on 2013/05/16 17:33:13 UTC

Deleting an entry from a collection when they key has ":" in it

Hi All,

 

I seem to be really struggling to delete an entry from  a search repository
that has a ":" in the key.

 

The key is path to the file ie, "D:\somedir\somefile.pdf".

 

I want to use a query to delete it and I just can't seem to make it go away.

 

I've been trying stuff lke this:

http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
<http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery
%3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplina
ry\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E&version=2.2&start=0&rows=10&
indent=on> &version=2.2&start=0&rows=10&indent=on

 

It doesn't throw an error but it doesn't delete the document either.

 

Does anyone have any suggestions?

 

Thanks,

Dan


RE: Deleting an entry from a collection when they key has ":" in it

Posted by Chris Hostetter <ho...@fucit.org>.
: If in my schema, I have the "key" field set to indexed=false, then is that
: maybe the issue?  I'm going to try to set that to true and rebuild the
: repository and see if that does it.

if a field is indexed="false" you can not query on it.

if you can not query on a field, then you can not delete by a query 
against that field.


-Hoss

Re: Deleting an entry from a collection when they key has ":" in it

Posted by Jason Hellman <jh...@innoventsolutions.com>.
The first rule of Solr without Unique Key is that we don't talk about Solr without a Unique Key.

The second rule...

On May 16, 2013, at 8:47 PM, Jack Krupansky <ja...@basetechnology.com> wrote:

> Technically, core Solr does not require a unique key. A lot of features in Solr do require unique keys, and it is recommended that you have unique keys, but it is not an absolute requirement.
> 
> -- Jack Krupansky
> -----Original Message----- From: Daniel Baughman
> Sent: Thursday, May 16, 2013 1:50 PM
> To: solr-user@lucene.apache.org
> Subject: RE: Deleting an entry from a collection when they key has ":" in it
> 
> Thanks for the idea....
> http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
> 3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
> y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
> 
> I do have :'s and  \'s escaped, I believe.
> 
> If in my schema, I have the "key" field set to indexed=false, then is that
> maybe the issue?  I'm going to try to set that to true and rebuild the
> repository and see if that does it.
> 
> 
> -----Original Message-----
> From: Jack Krupansky [mailto:jack@basetechnology.com]
> Sent: Thursday, May 16, 2013 11:20 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Deleting an entry from a collection when they key has ":" in it
> 
> You need to escape colons in queries, using either a backslash or enclosing
> the full query term in quotes.
> 
> In your case, you have backslashes as well in your query, which the query
> parser will interpret as an escape! So, you need to escape those backslashes
> as well:
> 
> D\:\\somedir\\somefile.pdf
> 
> or
> 
> "D:\\somedir\\somefile.pdf"
> 
> -- Jack Krupansky
> 
> -----Original Message-----
> From: Daniel Baughman
> Sent: Thursday, May 16, 2013 11:33 AM
> To: solr-user@lucene.apache.org
> Subject: Deleting an entry from a collection when they key has ":" in it
> 
> Hi All,
> 
> 
> 
> I seem to be really struggling to delete an entry from  a search repository
> that has a ":" in the key.
> 
> 
> 
> The key is path to the file ie, "D:\somedir\somefile.pdf".
> 
> 
> 
> I want to use a query to delete it and I just can't seem to make it go away.
> 
> 
> 
> I've been trying stuff lke this:
> 
> http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
> 3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
> y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
> <http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery
> %3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplina
> ry\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E&version=2.2&start=0&rows=10&
> indent=on> &version=2.2&start=0&rows=10&indent=on
> 
> 
> 
> It doesn't throw an error but it doesn't delete the document either.
> 
> 
> 
> Does anyone have any suggestions?
> 
> 
> 
> Thanks,
> 
> Dan 


Re: Deleting an entry from a collection when they key has ":" in it

Posted by Chris Hostetter <ho...@fucit.org>.
: Technically, core Solr does not require a unique key. A lot of features in

nohting in this thread refered to the uniqueKey field, or the lack of a 
uniqueKey field in the users schema, at all until you brought it up.

 * the user has a field named "key"
 * the user had a question about deleting by query where the 
   queries involved the field named "key"
 * the user stated that the field named "key" is not indexed...

: If in my schema, I have the "key" field set to indexed=false, then is that
: maybe the issue?  I'm going to try to set that to true and rebuild the
: repository and see if that does it.


..cut and dry, no need to confuse the issue more.


-Hoss

Re: Deleting an entry from a collection when they key has ":" in it

Posted by Jack Krupansky <ja...@basetechnology.com>.
Technically, core Solr does not require a unique key. A lot of features in 
Solr do require unique keys, and it is recommended that you have unique 
keys, but it is not an absolute requirement.

-- Jack Krupansky
-----Original Message----- 
From: Daniel Baughman
Sent: Thursday, May 16, 2013 1:50 PM
To: solr-user@lucene.apache.org
Subject: RE: Deleting an entry from a collection when they key has ":" in it

Thanks for the idea....
http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E

I do have :'s and  \'s escaped, I believe.

If in my schema, I have the "key" field set to indexed=false, then is that
maybe the issue?  I'm going to try to set that to true and rebuild the
repository and see if that does it.


-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com]
Sent: Thursday, May 16, 2013 11:20 AM
To: solr-user@lucene.apache.org
Subject: Re: Deleting an entry from a collection when they key has ":" in it

You need to escape colons in queries, using either a backslash or enclosing
the full query term in quotes.

In your case, you have backslashes as well in your query, which the query
parser will interpret as an escape! So, you need to escape those backslashes
as well:

D\:\\somedir\\somefile.pdf

or

"D:\\somedir\\somefile.pdf"

-- Jack Krupansky

-----Original Message-----
From: Daniel Baughman
Sent: Thursday, May 16, 2013 11:33 AM
To: solr-user@lucene.apache.org
Subject: Deleting an entry from a collection when they key has ":" in it

Hi All,



I seem to be really struggling to delete an entry from  a search repository
that has a ":" in the key.



The key is path to the file ie, "D:\somedir\somefile.pdf".



I want to use a query to delete it and I just can't seem to make it go away.



I've been trying stuff lke this:

http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
<http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery
%3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplina
ry\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E&version=2.2&start=0&rows=10&
indent=on> &version=2.2&start=0&rows=10&indent=on



It doesn't throw an error but it doesn't delete the document either.



Does anyone have any suggestions?



Thanks,

Dan 


RE: Deleting an entry from a collection when they key has ":" in it

Posted by Daniel Baughman <da...@hostworks.com>.
Thanks for the idea....
http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E

I do have :'s and  \'s escaped, I believe.

If in my schema, I have the "key" field set to indexed=false, then is that
maybe the issue?  I'm going to try to set that to true and rebuild the
repository and see if that does it.


-----Original Message-----
From: Jack Krupansky [mailto:jack@basetechnology.com] 
Sent: Thursday, May 16, 2013 11:20 AM
To: solr-user@lucene.apache.org
Subject: Re: Deleting an entry from a collection when they key has ":" in it

You need to escape colons in queries, using either a backslash or enclosing
the full query term in quotes.

In your case, you have backslashes as well in your query, which the query
parser will interpret as an escape! So, you need to escape those backslashes
as well:

D\:\\somedir\\somefile.pdf

or

"D:\\somedir\\somefile.pdf"

-- Jack Krupansky

-----Original Message-----
From: Daniel Baughman
Sent: Thursday, May 16, 2013 11:33 AM
To: solr-user@lucene.apache.org
Subject: Deleting an entry from a collection when they key has ":" in it

Hi All,



I seem to be really struggling to delete an entry from  a search repository
that has a ":" in the key.



The key is path to the file ie, "D:\somedir\somefile.pdf".



I want to use a query to delete it and I just can't seem to make it go away.



I've been trying stuff lke this:

http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
<http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery
%3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplina
ry\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E&version=2.2&start=0&rows=10&
indent=on> &version=2.2&start=0&rows=10&indent=on



It doesn't throw an error but it doesn't delete the document either.



Does anyone have any suggestions?



Thanks,

Dan


Re: Deleting an entry from a collection when they key has ":" in it

Posted by Jack Krupansky <ja...@basetechnology.com>.
You need to escape colons in queries, using either a backslash or enclosing 
the full query term in quotes.

In your case, you have backslashes as well in your query, which the query 
parser will interpret as an escape! So, you need to escape those backslashes 
as well:

D\:\\somedir\\somefile.pdf

or

"D:\\somedir\\somefile.pdf"

-- Jack Krupansky

-----Original Message----- 
From: Daniel Baughman
Sent: Thursday, May 16, 2013 11:33 AM
To: solr-user@lucene.apache.org
Subject: Deleting an entry from a collection when they key has ":" in it

Hi All,



I seem to be really struggling to delete an entry from  a search repository
that has a ":" in the key.



The key is path to the file ie, "D:\somedir\somefile.pdf".



I want to use a query to delete it and I just can't seem to make it go away.



I've been trying stuff lke this:

http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery%
3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplinar
y\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E
<http://localhost:8983/solr/docrepo/update/?stream.body=%3Cdelete%3E%3Cquery
%3Ekey%3AD\:\\Webdocs\\sw4\\docRepo\\documents\\Hiring%20Manager\\Disciplina
ry\\asdfasdf\.docx%3C%2Fquery%3E%3C%2Fdelete%3E&version=2.2&start=0&rows=10&
indent=on> &version=2.2&start=0&rows=10&indent=on



It doesn't throw an error but it doesn't delete the document either.



Does anyone have any suggestions?



Thanks,

Dan