[Xapian-discuss] Very confused please help

John Wards j.wards at sportnetwork.net
Sat Jan 14 14:33:17 GMT 2006


Quoting Olly Betts <olly at survex.com>:
> On Thu, Jan 12, 2006 at 01:25:42PM +0000, John Wards wrote:
> > But for the life of me I can not figure out how to get Omega to do the
> > sorting by price asc/desc.
>
> In the scriptindex index description change this line:
>
> > price: field
>
> to this:
>
> price: field value=0
>

Brilliant!

>
> And then tell Omega to sort on value 0 by passing CGI parameters:
>
> SORT=0
>
> But beware that the sort is a STRING sort, not numeric.  The simple fix
> is to left pad the price to a suitable width with spaces or zeros.

Can I put a feature request in...numeric searches? ;-) But you are right it
should be a simple fix, will have a play.

> > I would love to be able to use the PHP bindings but I can't get my head
> > around the examples...
> >
> > address: "fir tree"
> > countyid: XL19
> > sold: XSOLD0
> > sold: XUNDER0
>
> Most of it is going to be identical to the simplesearch.php example,
> except you want to build a different query.  Something like:
>
> $qp = new_QueryParser();
> $query = $qp->parse_query('"fir tree"');
> $query = new_Query_from_query_pair(Query_OP_FILTER, $query,
> new_Query("XL19"));
> $query = new_Query_from_query_pair(Query_OP_FILTER, $query,
> new_Query("XSOLD0"));
> $query = new_Query_from_query_pair(Query_OP_FILTER, $query,
> new_Query("XUNDER0"));

Huzza! Thanks, much better code now. Hopefully I should be able to speed
everything up now.

> That's assuming you want XSOLD0 AND XUNDER0 - which I guess makes sense
> if that means "(not sold) and (not under-offer)".

Yup spot on.

> If using the next release, you'd just write new_Query instead of
> new_Query_from_query_pair

Is that 0.9.2 > I have just upgraded from 0.8.2 today (bad John..) and
everything seems to be running fine...last time I upgraded it broke hence the
reluctance to upgrade.

Thanks (A much less confused)
John

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the Xapian-discuss mailing list