You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mandar Deshpande <ma...@ebi.ac.uk> on 2017/05/11 12:16:40 UTC

JSON facet API issue

Dear Solr users,

 

We are upgrading from solr 4.x to solr 6.5 and one important part of it is
to implement json API in our application.

 

Our facet query uses group.facet, in order to support this we have used
facet aggregation function 'unique(myField)' to get the unique count. 

After doing the update we are getting strange results in which the count
(uniqueCount) for the first facet bucket is correct and the remaining are
either 0 or incorrect.

 

Below are the both the solr query urls for reference :

 

Old

http://wwwdev.ebi.ac.uk/pdbe/search/pdb/select?group=true&group.field=pdb_id
&group.ngroups=true&group.facet=true&facet=true&rows=0&facet.limit=100&facet
.mincount=1&facet.sort=count&json.nl=map&facet.field=detector&facet.field=ex
perimental_method&facet.range=deposition_year&f.deposition_year.facet.range.
start=1970&f.deposition_year.facet.range.end=2050&f.deposition_year.facet.ra
nge.gap=5&f.deposition_year.facet.range.other=between&f.deposition_year.face
t.range.include=upper&q=text%3Ahemoglobin&wt=json&indent=true

 

New (json api implementation)

http://wwwdev.ebi.ac.uk/pdbe/search/pdb/select?json={query:%20%22text:hemogl
obin%22,%20facet:%20{%20detector:%20{type:%20%27terms%27,%20field:%20%27dete
ctor%27,%20limit:%20100,%20mincount:%201,%20sort:count,%20facet:%20{%20uniqu
eCount:%20%22unique(pdb_id)%22%20}%20},%20experimental_method:%20{type:%20%2
7terms%27,%20field:%20%27experimental_method%27,%20limit:%20100,%20mincount:
%201,%20sort:count,%20facet:%20{%20uniqueCount:%20%22unique(pdb_id)%22%20}%2
0},%20deposition_year:%20{%20type:%20%27range%27,%20field:%20%27deposition_y
ear%27,%20start:%201970,%20end:%202050,%20gap:%205,%20other:%20%27between%27
,%20include%20:%20%27upper%27,%20limit:%20100,%20mincount:%201,%20sort:count
,%20facet:%20{%20uniqueCount:%20%22unique(pdb_id)%22%20}%20}%20}%20}&rows=0&
wt=json&indent=true

 

Am I missing something in the new facet json api query or it is a solr issue
?

 

Thanks and regards,

Mandar Deshpande

 

Web Developer, Protein Databank in Europe (PDBe)

European Molecular Biology Laboratory

European Bioinformatics Institute (EMBL-EBI) 

Wellcome Trust Genome Campus 

Hinxton Cambridge CB10 1SD, UK