[Xapian-discuss] Hyphen search with parse_query()

Michel Pelletier pelletier.michel at gmail.com
Thu Apr 15 16:09:36 BST 2010


He provided it to you, you use the Query() constructor to add a "raw"
term to your query.  You can use this in conjunction with the query
parser:

Query(Query.OP_AND, query_parser.parse_query(your_query_string),
Query("ssh-add"))

insert the operator of your choice.

On a related note, long ago I had used the pyparsing library to create
a simple query language for my xapian work at the time.  Since then,
the xapian query parser and my knowledge of it has improved such that
it was no longer necessary.  Maybe it would be useful to open a
discussion on a query language, and use a simple tool like that to
spike out a new prototype language that could be used to improve the
next generation of the query parser.

-Mike

On Thu, Apr 15, 2010 at 2:13 AM, Peter Bengtsson <peter at fry-it.com> wrote:
> On 15 April 2010 01:52, Olly Betts <olly at survex.com> wrote:
>> On Wed, Mar 31, 2010 at 03:00:00PM +0100, Peter Bengtsson wrote:
>>> How do I make the search for exactly "peter-bengtsson" or exacly
>>> "ssh-add" or "e-mail"?
>>
>>    query = xapian.Query("peter-bengtsson")
>>
>> (You can't currently achieve with using QueryParser).
>>
> So what is the alternative? If there is one.
>
>
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com
> fun crosstips.org
>
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>



More information about the Xapian-discuss mailing list