bsed / ala

Automatically exported from code.google.com/p/ala
0 stars 0 forks source link

Issues with fq in fulltext search #611

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Re - http://bie.ala.org.au/ws/search.json?q={q}&fq={fq}

1. which fields can we actually query for fq? API doc says: "See 
http://biocache.ala.org.au/ws/index/fields for all the fields that a 
queryable." 

BUT "species" appears in this list of fields, and yet
GET(url="http://bie.ala.org.au/ws/search.json?q=Grevillea&fq=kingdom:Plantae") 
# works

GET(url="http://bie.ala.org.au/ws/search.json?q=Grevillea&fq=genus:Grevillea") 
# works

GET(url="http://bie.ala.org.au/ws/search.json?q=Grevillea&fq=species:banksii") 
#500 error, with message "undefined field species"

Should we instead be using the "general" fields 
(http://bie.ala.org.au/ws/admin/indexFields), but note that this service is not 
currently part of the API

2. fq matches are case-sensitive, but casing of names is not consistent (e.g. 
kingdoms "Fungi" and "Plantae" but "ANIMALIA")

fulltext_search("Oenanthe") # returns a mix of birds and plants, because 
Oenanthe is a genus name in both kingdoms

fulltext_search("Oenanthe",fq="kingdom:Plantae") ## OK

fulltext_search("Oenanthe",fq="kingdom:plantae") ## no results

fulltext_search("Oenanthe",fq="kingdom:PLANTAE") ## no results

fulltext_search("Oenanthe",fq="kingdom:Animalia") ## no results

fulltext_search("Oenanthe",fq="kingdom:ANIMALIA") ## OK

Suggest either that fq matches are made case-insensitive, or the names are 
consistently cased.

Original issue reported on code.google.com by antarcti...@gmail.com on 15 Mar 2014 at 5:52

GoogleCodeExporter commented 9 years ago
3. Also, what's the syntax for specifying multiple fq arguments?

Original comment by antarcti...@gmail.com on 16 Mar 2014 at 5:19

GoogleCodeExporter commented 9 years ago
Multiple fq's - follows http spec. &fq=dave:dave1&fq=dave:dave2

Im not sure why "species" isnt working on fqs. We'll look into that.
fq's are case sensitive and this wont change as it would break existing apps.

Original comment by moyesyside on 19 Mar 2014 at 3:12

GoogleCodeExporter commented 9 years ago
This was a bug with the doco which ive now updated.

http://api.ala.org.au/#ws87

the indexed field for the species index (completely separate to occurrence 
index) are listed here

http://bie.ala.org.au/ws/admin/indexFields

"species" isnt an indexed. "scientificName" is.

Original comment by moyesyside on 19 Mar 2014 at 3:21

GoogleCodeExporter commented 9 years ago
Addendum to Multiple fq's question

Multiple fqs are AND-ed by default. For OR-ing you'll need to include multiple 
params in the same request param e.g.

fq=dave:dave1 OR dave:dave2

Original comment by moyesyside on 20 Mar 2014 at 3:13