[ckan-dev] change search from OR to AND (hotz)

Aaron McGlinchy McGlinchyA at landcareresearch.co.nz
Wed Aug 20 23:40:37 UTC 2014


Update, while using and or works, it only partly (and inconsistently) works.

I also have 2 additional datasets tagged "seed plants".

I would expect a search for moss and "seed plants" to return zero results (as no dataset has both those tags present), it actually returns 8 results (what would be expected from and OR search).

At the same time I would expect an or search to return 8 datasets, but it only returns 5.

Search  Moss "seed plants"   returns zero (=as expected per an AND search)
        Moss and "seed plants"  = 8 (why?)
        Moss or "seed plants" = 5 (would expect 8?)

-----Original Message-----
From: Aaron McGlinchy
Sent: Thursday, 21 August 2014 11:22 a.m.
To: 'ckan-dev at lists.okfn.org'
Subject: Re: change search from OR to AND (hotz)

Our install of CKAN (v2.2) seems to search AND by default, but I can actually specify operator such as OR or AND in my search text and it refines the result accordingly.

e.g. I have 8 datasets that have the tag Flora, and of them 6 also have the tag Moss.

A search for    moss flora   returns 6 results (= moss and flora)
                moss or flora    returns 8 results
                "moss or flora" = zero results (no datasets have the exact tag/text "moss or flora"

So you can use the normal sorts of formatting/operators in the search box (just as in google) to fine tune the search, no special coding required (at least on v2.2)

Cheers
Aaron

________________________________

Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz



More information about the ckan-dev mailing list