[Xapian-tickets] [Xapian] #456: Add support for a prefix to control parsing of a value-range specification

Xapian nobody at xapian.org
Wed Oct 24 04:15:54 BST 2012


#456: Add support for a prefix to control parsing of a value-range specification
-------------------------+--------------------------------------------------
 Reporter:  cworth       |       Owner:  olly    
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  1.3.x   
Component:  QueryParser  |     Version:          
 Severity:  normal       |    Keywords:          
Blockedby:               |    Platform:  All     
 Blocking:               |  
-------------------------+--------------------------------------------------
Changes (by olly):

  * status:  new => assigned
  * milestone:  1.2.x => 1.3.x


Old description:

> I've been able to use Xapian's existing ValueRangeParser class to
> support date ranges similar to:
>
>         20100101..20100131
>
> but what I'd really like instead is something like:
>
>         date:"January 2010"
>
> or:
>
>         date:"this month"
>
> Using a prefix like this matches the way the rest of my search strings
> are constructed, and as can be seen in the examples above, I want to
> support specifications of a range that don't have anything like the
> ".." syntax in them.
>
> Obviously, I'll be happy to do my own parsing of strings like "January
> 2010" and "this month"---I just need a mechanism to hook my custom
> function to a prefixed chunk of query text.
>
> Olly suggested maybe the interface could be as general as my function
> just returning a query object. That would be a fairly powerful
> interface for doing all kinds of interesting things.

New description:

 I've been able to use Xapian's existing !ValueRangeParser class to
 support date ranges similar to:

         20100101..20100131

 but what I'd really like instead is something like:

         date:"January 2010"

 or:

         date:"this month"

 Using a prefix like this matches the way the rest of my search strings
 are constructed, and as can be seen in the examples above, I want to
 support specifications of a range that don't have anything like the
 ".." syntax in them.

 Obviously, I'll be happy to do my own parsing of strings like "January
 2010" and "this month"---I just need a mechanism to hook my custom
 function to a prefixed chunk of query text.

 Olly suggested maybe the interface could be as general as my function
 just returning a query object. That would be a fairly powerful
 interface for doing all kinds of interesting things.

--

Comment:

 I added a !FieldProcessor class in r16807 which is intended to provide
 this sort of ability.  Currently quoted arguments aren't handled though,
 so it doesn't support the exact cases mentioned here yet.

-- 
Ticket URL: <http://trac.xapian.org/ticket/456#comment:2>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list