bsed / ala

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

biocache-service: inconsistent activeFacetMap values in search results JSON #607

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
E.g. 
http://biocache.ala.org.au/ws/occurrences/search?q=flower&fq=taxon_name%3A%22Lom
andra+longifolia%22&fq=raw_taxon_name%3A%22Lomandra+longifolia%22&fq=-basis_of_r
ecord%3AHumanObservation&fq=-(month:04%20OR%20month:05%20OR%20month:06)

see ->

"activeFacetMap" : {
   "-basis_of_record" : { 
     "displayName" : "-basis_of_record:HumanObservation",
     "name" : "-basis_of_record",
     "value" : "HumanObservation"
   },
   "month" : { 
     "displayName" : "-Month:April OR Month:May OR Month:June",
     "name" : "month",
     "value" : "04 OR month:05 OR month:06"
   },
   "raw_taxon_name" : { 
     "displayName" : "Scientific name (unprocessed):Lomandra longifolia",
     "name" : "raw_taxon_name",
     "value" : "\"Lomandra longifolia\""
   },
   "taxon_name" : { 
     "displayName" : "Scientific name:Lomandra longifolia",
     "name" : "taxon_name",
     "value" : "\"Lomandra longifolia\""
   }
} 

The issue is with the "name" attribute when an "exclude" filter is applied with 
multiple (OR'ed) values. In this case (month) the name attribute is missing the 
leading minus sign. The JSON key for the group should also have a leading minus 
sign (see basis_of_record).

Also, the "displayName" attribute should include the surrounding braces from 
the original "fq" param.

Original issue reported on code.google.com by nickdos on 13 Mar 2014 at 1:58

GoogleCodeExporter commented 9 years ago
This following issues will be fixed:
1) The key for the active facet map will not include the minus sign for 
excluded values
2) The display name will return the original braces that were provided in the 
filter.

There is a fundamental issue with the name and values fields of a multi 
conditional filter. But i can not be change due to the backward compatibility 
that is necessary for the hubs.  In this situation it is impossible to supply a 
negative sign to the name, because without braces support it would change the 
meaning of the filter. 

Braces support does not make sense because I wouldn't want to see:
"month" : { 
     "displayName" : "-(Month:April OR Month:May OR Month:June)",
     "name" : "-month",
     "value" : "(04 OR month:05 OR month:06)"
   }

As this is not correct from a SOLR point of view.

Original comment by natasha....@csiro.au on 8 Apr 2014 at 2:07

GoogleCodeExporter commented 9 years ago
Checked in changes.

Original comment by natasha....@csiro.au on 8 Apr 2014 at 2:37

GoogleCodeExporter commented 9 years ago
Nick we have discussed the inconsistencies with the facet map and the issues 
relating to fixing it. It is up to you whether or not you close this issues.

Original comment by natasha....@csiro.au on 1 May 2014 at 6:36