AtlasOfLivingAustralia / biocache-service

Occurrence & mapping webservices
https://biocache-ws.ala.org.au/ws/
Other
9 stars 26 forks source link

biocache-service has issue in parsing fq #729

Closed alexhuang091 closed 11 months ago

alexhuang091 commented 2 years ago

run this query https://biocache.ala.org.au/occurrence/search?qualityProfile=ALA&disableAllQualityFilters=true&fq=basisOfRecord:"MATERIAL_SAMPLE" AND contentTypes:"EnvironmentalDNA" returns 1,029,740 records.

https://biocache.ala.org.au/occurrence/search?qualityProfile=ALA&disableAllQualityFilters=true&fq=+basisOfRecord:"MATERIAL_SAMPLE" +contentTypes:"EnvironmentalDNA" returns 1,493,360 records.



But when feeding 2 fqs directly into solr admin console, they return same number of records.

for basisOfRecord:"MATERIAL_SAMPLE" AND contentTypes:"EnvironmentalDNA" 111

for +basisOfRecord:"MATERIAL_SAMPLE" +contentTypes:"EnvironmentalDNA" 112

This may be related to https://github.com/AtlasOfLivingAustralia/DataQuality/issues/262. After this is fixed we can check if #DQ262 is still an issue.

alexhuang091 commented 2 years ago

debug shows the + which means requires are removed by pre-processing so what got passed into solr is basisOfRecord:"MATERIAL_SAMPLE" contentTypes:"EnvironmentalDNA" that's why solr returns 1,493,360 records.

截屏2021-11-25 下午12 41 24


截屏2021-11-25 下午12 46 54
alexhuang091 commented 2 years ago

Seems we need to url encode +basisOfRecord:"MATERIAL_SAMPLE" +contentTypes:"EnvironmentalDNA" first then append to fq=

adam-collins commented 11 months ago

Only a subset of SOLR query syntax is supported. I recommend users use AND.

Not adding support for +fieldName as this may generate more work if switching to Elasticsearch.