[Xapian-discuss] Re: Prefixes

Fabrice Colin fabrice.colin at gmail.com
Wed Jan 31 13:50:31 GMT 2007


On 1/31/07, James Aylett <james-xapian at tartarus.org> wrote:
> On Tue, Jan 30, 2007 at 12:36:39PM +0800, Fabrice Colin wrote:
> > >There isn't currently a way to quote such a prefixed boolean term, but
> > >shouldn't spaces be quoted as %20 in a url anyway?
> >
> > Yes, for a URL, quoting makes sense, but for a file name filter, not
> > so much.  For instance, entering something like 'file:"My CV.txt"'
> > is not completely unreasonable.
> >
> > Actually, this would be useful for searching indexes built by
> > omindex.  As far as I can tell it doesn't escape U-prefixed terms,
> > so if a user wanted to find the document that has the term
> > 'Uhttp://localhost/some file.txt', he would have to enter
> > 'url:http://localhost/some%20file.txt', and the app would have to
> > unescape the U-prefixed term in the Query object generated by the
> > QueryParser.
>
> 'http://localhost/some file.txt' is not a valid URI; you MUST replace
> the SPC with either '+' or '%20'. omindex may not be getting all of
> this right, but it's the application's job rather than the user's.
>
To be honest, termprefixes.txt doesn't specify that the U prefix is for
a "valid URI". It just says the "full URL". I know I am splitting hairs :-)

> ('file:"My CV.txt"' is similarly not a valid URI. Again, the
> application should be fixing things up somehow.)
>
Ah. This one is not a URI, it's a (valid) file name.

The problem is that "fixing things up" here means pre-processing the string
before it's fed to the QueryParser, which partially nullifies the QueryParser's
usefulness. Never mind, I will just have to add this to my TODO list :-)

Cheers.

Fabrice



More information about the Xapian-discuss mailing list