Do path: searches handle spaces correctly?

2014-09-23 Thread David Bremner
Keith Amidon  writes:

>
> What do you think about adding a section to the notmuch-search-terms web
> page that talks in more detail about the quoting interactions?  If there
> were on obvious section about this in the man page it might have helped
> me find the issue myself.  If this seems like a good idea I'll take a
> crack at it later this week when I get time to research the Xapian
> quoting in a bit more detail.

Yes, it makes sense to add such a section.

d


Re: Do path: searches handle spaces correctly?

2014-09-23 Thread David Bremner
Keith Amidon cama...@picnicpark.org writes:


 What do you think about adding a section to the notmuch-search-terms web
 page that talks in more detail about the quoting interactions?  If there
 were on obvious section about this in the man page it might have helped
 me find the issue myself.  If this seems like a good idea I'll take a
 crack at it later this week when I get time to research the Xapian
 quoting in a bit more detail.

Yes, it makes sense to add such a section.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Do path: searches handle spaces correctly?

2014-09-22 Thread Keith Amidon
On Mon, 2014-09-22 at 15:06 +, Austin Clements wrote:
> I assume you're doing this from the command line?  Does the following
> work?
> 
> notmuch search --output=files 'path:"dir/INBOX/INBOX/Sent Items/**"'
> 
> Shell quoting and Xapian quoting interact in often confusing ways.  In
> your original command line, the single quotes suppress shell argument
> splitting, but never make it to notmuch, so notmuch sees two search
> terms "path:dir/INBOX/INBOX/Sent" and "Items/**".  In the command line
> I suggested, the single quotes play the same role, but for the entire
> query.  Because of the quoting, notmuch *does* see the inner double
> quotes, which makes the path a single term (note that Xapian only
> accepts double quotes, not single quotes).  In general, it's good to
> enclose the entire command line query in single quotes so shell
> parsing doesn't get in the way of query parsing.

Bingo.  That was it.  Thanks for clarifying how the quoting interacts. 

What do you think about adding a section to the notmuch-search-terms web
page that talks in more detail about the quoting interactions?  If there
were on obvious section about this in the man page it might have helped
me find the issue myself.  If this seems like a good idea I'll take a
crack at it later this week when I get time to research the Xapian
quoting in a bit more detail.

--- Keith



Do path: searches handle spaces correctly?

2014-09-22 Thread Austin Clements
Quoth Keith Amidon on Sep 22 at  7:42 am:
> On Mon, 2014-09-22 at 11:20 +0200, David Bremner wrote:
> > Keith Amidon  writes:
> > >
> > > notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'
> > >
> > > I don't get any results, but it seems like the two results above should
> > > be shown, right?  Am I doing something wrong here?  If it looks like I'm
> > > doing it correctly, what can I do to help troubleshoot the issue?
> > 
> > Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
> > if that's the only issue you are having, but I guess it's one.
> 
> Darn it!  I made a mistake in my original email.  In the test I was
> doing I actually had:
> 
> notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items/**'
> 
> which I believe should have picked up all the subdirectory paths.  I
> just retested to make sure that it still didn't work, and it doesn't.
> 
> Am I still missing something?   Thanks for the help, Keith

I assume you're doing this from the command line?  Does the following
work?

notmuch search --output=files 'path:"dir/INBOX/INBOX/Sent Items/**"'

Shell quoting and Xapian quoting interact in often confusing ways.  In
your original command line, the single quotes suppress shell argument
splitting, but never make it to notmuch, so notmuch sees two search
terms "path:dir/INBOX/INBOX/Sent" and "Items/**".  In the command line
I suggested, the single quotes play the same role, but for the entire
query.  Because of the quoting, notmuch *does* see the inner double
quotes, which makes the path a single term (note that Xapian only
accepts double quotes, not single quotes).  In general, it's good to
enclose the entire command line query in single quotes so shell
parsing doesn't get in the way of query parsing.


Do path: searches handle spaces correctly?

2014-09-22 Thread David Bremner
Keith Amidon  writes:

>
> notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'
>
> I don't get any results, but it seems like the two results above should
> be shown, right?  Am I doing something wrong here?  If it looks like I'm
> doing it correctly, what can I do to help troubleshoot the issue?

Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
if that's the only issue you are having, but I guess it's one.

d


Do path: searches handle spaces correctly?

2014-09-22 Thread Keith Amidon
On Mon, 2014-09-22 at 11:20 +0200, David Bremner wrote:
> Keith Amidon  writes:
> >
> > notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'
> >
> > I don't get any results, but it seems like the two results above should
> > be shown, right?  Am I doing something wrong here?  If it looks like I'm
> > doing it correctly, what can I do to help troubleshoot the issue?
> 
> Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
> if that's the only issue you are having, but I guess it's one.

Darn it!  I made a mistake in my original email.  In the test I was
doing I actually had:

notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items/**'

which I believe should have picked up all the subdirectory paths.  I
just retested to make sure that it still didn't work, and it doesn't.

Am I still missing something?   Thanks for the help, Keith




Do path: searches handle spaces correctly?

2014-09-22 Thread Keith Amidon
I'm trying to update an archiving tool that used the old folder: search
terms to use the newer folder: or path: terms.  From playing around with
it, I think that the path: term is what I want to use.  However, I am
getting some behavior I don't understand unless path: searches don't
properly handle spaces or I don't know how to quote them properly.

If I do:

notmuch search --output=files path:'dir/INBOX/**'

I get:

base/dir/INBOX/cur/1411244319_3.18990.kea-tablet,U=24,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/cur/1411244319_2.18990.kea-tablet,U=23,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/INBOX/Sent 
Items/cur/1411244324_2.18990.kea-tablet,U=3,FMD5=e99e6ef6cc1489bb6d8b47a4c49bb989:2,S
base/dir/INBOX/cur/1411244319_1.18990.kea-tablet,U=22,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,RS
base/dir/INBOX/cur/1411244319_0.18990.kea-tablet,U=21,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/cur/1411244318_3.18990.kea-tablet,U=20,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/cur/1411244318_2.18990.kea-tablet,U=19,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/cur/1411244318_1.18990.kea-tablet,U=18,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
base/dir/INBOX/INBOX/Sent 
Items/cur/1411244324_1.18990.kea-tablet,U=2,FMD5=e99e6ef6cc1489bb6d8b47a4c49bb989:2,S
base/dir/INBOX/cur/1411244318_0.18990.kea-tablet,U=17,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S

Notice that this contains results for dir/INBOX/INBOX/Sent Items,
which has a space in it.  If I do:

notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'

I don't get any results, but it seems like the two results above should
be shown, right?  Am I doing something wrong here?  If it looks like I'm
doing it correctly, what can I do to help troubleshoot the issue?

 Thanks, Keith
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Do path: searches handle spaces correctly?

2014-09-22 Thread Austin Clements
Quoth Keith Amidon on Sep 22 at  7:42 am:
 On Mon, 2014-09-22 at 11:20 +0200, David Bremner wrote:
  Keith Amidon ke...@awakenetworks.com writes:
  
   notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'
  
   I don't get any results, but it seems like the two results above should
   be shown, right?  Am I doing something wrong here?  If it looks like I'm
   doing it correctly, what can I do to help troubleshoot the issue?
  
  Note that path:, unlike folder:, does not add the maildir subdirs. Dunno
  if that's the only issue you are having, but I guess it's one.
 
 Darn it!  I made a mistake in my original email.  In the test I was
 doing I actually had:
 
 notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items/**'
 
 which I believe should have picked up all the subdirectory paths.  I
 just retested to make sure that it still didn't work, and it doesn't.
 
 Am I still missing something?   Thanks for the help, Keith

I assume you're doing this from the command line?  Does the following
work?

notmuch search --output=files 'path:dir/INBOX/INBOX/Sent Items/**'

Shell quoting and Xapian quoting interact in often confusing ways.  In
your original command line, the single quotes suppress shell argument
splitting, but never make it to notmuch, so notmuch sees two search
terms path:dir/INBOX/INBOX/Sent and Items/**.  In the command line
I suggested, the single quotes play the same role, but for the entire
query.  Because of the quoting, notmuch *does* see the inner double
quotes, which makes the path a single term (note that Xapian only
accepts double quotes, not single quotes).  In general, it's good to
enclose the entire command line query in single quotes so shell
parsing doesn't get in the way of query parsing.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Do path: searches handle spaces correctly?

2014-09-22 Thread Keith Amidon
On Mon, 2014-09-22 at 15:06 +, Austin Clements wrote:
 I assume you're doing this from the command line?  Does the following
 work?
 
 notmuch search --output=files 'path:dir/INBOX/INBOX/Sent Items/**'
 
 Shell quoting and Xapian quoting interact in often confusing ways.  In
 your original command line, the single quotes suppress shell argument
 splitting, but never make it to notmuch, so notmuch sees two search
 terms path:dir/INBOX/INBOX/Sent and Items/**.  In the command line
 I suggested, the single quotes play the same role, but for the entire
 query.  Because of the quoting, notmuch *does* see the inner double
 quotes, which makes the path a single term (note that Xapian only
 accepts double quotes, not single quotes).  In general, it's good to
 enclose the entire command line query in single quotes so shell
 parsing doesn't get in the way of query parsing.

Bingo.  That was it.  Thanks for clarifying how the quoting interacts. 

What do you think about adding a section to the notmuch-search-terms web
page that talks in more detail about the quoting interactions?  If there
were on obvious section about this in the man page it might have helped
me find the issue myself.  If this seems like a good idea I'll take a
crack at it later this week when I get time to research the Xapian
quoting in a bit more detail.

--- Keith

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Do path: searches handle spaces correctly?

2014-09-20 Thread Keith Amidon
I'm trying to update an archiving tool that used the old folder: search
terms to use the newer folder: or path: terms.  From playing around with
it, I think that the path: term is what I want to use.  However, I am
getting some behavior I don't understand unless path: searches don't
properly handle spaces or I don't know how to quote them properly.

If I do:

notmuch search --output=files path:'dir/INBOX/**'

I get:

/dir/INBOX/cur/1411244319_3.18990.kea-tablet,U=24,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/cur/1411244319_2.18990.kea-tablet,U=23,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/INBOX/Sent 
Items/cur/1411244324_2.18990.kea-tablet,U=3,FMD5=e99e6ef6cc1489bb6d8b47a4c49bb989:2,S
/dir/INBOX/cur/1411244319_1.18990.kea-tablet,U=22,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,RS
/dir/INBOX/cur/1411244319_0.18990.kea-tablet,U=21,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/cur/1411244318_3.18990.kea-tablet,U=20,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/cur/1411244318_2.18990.kea-tablet,U=19,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/cur/1411244318_1.18990.kea-tablet,U=18,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
/dir/INBOX/INBOX/Sent 
Items/cur/1411244324_1.18990.kea-tablet,U=2,FMD5=e99e6ef6cc1489bb6d8b47a4c49bb989:2,S
/dir/INBOX/cur/1411244318_0.18990.kea-tablet,U=17,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S

Notice that this contains results for "dir/INBOX/INBOX/Sent Items",
which has a space in it.  If I do:

notmuch search --output=files path:'dir/INBOX/INBOX/Sent Items'

I don't get any results, but it seems like the two results above should
be shown, right?  Am I doing something wrong here?  If it looks like I'm
doing it correctly, what can I do to help troubleshoot the issue?

 Thanks, Keith