query fails when more than one item selected in multiselect fields

24/06/10

Permalink 09:46:58 am, by sarneil, 127 words, 344 views   English (CA)
Categories: Activity log; Mins. worked: 120

query fails when more than one item selected in multiselect fields

MLH told me that if he did queries involving more than one choice in a multiselect field, the results coming back were wrong. For example,
If I search for remedy = bloodletting, I get 23 results
If I search for remedy = purge, I get 52 results
Before, when I searched for remedy = bloodletting OR purge I got 0 hits.

Problem was with code that generates the where clause in the SQL query, in particular where that code has to search 2 fields. It was generating a clause like this:
((remedy1 = "bloodletting OR purge") OR (remedy2 = "bloodletting OR purge"))
and so I corrected it to create a clause like this:
(((remedy1 = "bloodletting") OR (remedy1 = "purge")) OR ((remedy2 = "bloodletting") OR (remedy2 = "purge")))

Now, when I search for remedy = bloodletting OR purge, I get 58 hits.

Pingbacks:

No Pingbacks for this post yet...

German Medical Exams

This project will create an xml-based database of medical exam reports from the 16th through 19th centuries in Germany. The database will allow researchers to query medical practices in that time and to infer changes in the administration of medical care and other social changes.

Reports

Categories

May 2013
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

XML Feeds