isamplesorg / isamples_webui

Web interface to iSB and iSC APIs

Home Page:https://isamplesorg.github.io/isamples_webui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Displaying number of records in the facet

hyunssong opened this issue · comments

Current version of iSamples_listFacet displays the material type in a hierarchical view using customizedTreeView but the number of records that correspond to the label is not displayed. This is because currently the count of the records is set to 0.

I created a spreadsheet that compares our current iSamples material CV and the record's material field displayed in the webui here .

Based on this, what needs additional implementation is

  • Set code to display the total counts of each label.

  • When displaying the total counts, we also need to add the leaf node counts to the parent node counts (due to the hierarchical nature)

There is an interaction between the vocabulary definition, the indexing process, and the UI that needs to be considered since we want the counts for broader terms to include the counts for narrower terms.

For example, given the simple term hierarchy of:

 A
/ \
B  C
    \
     D

The number of records matching term A should include records including terms A, B, C, and D since B, C, D are narrower than A, and so are considered a type of A.

So with the records:

ID Facet
1 A
2 B
3 C
4 D

One approach for indexing would be to expand facet hierarchy per record, so the Solr index records would be like:

ID Facet
1 A
2 A, B
3 A, C
4 A, C, D

Then in the UI the counts per facet value would be:

Facet query n
A count facet:A 4
B count facet:B 1
C count facet:C 2
D count facet:D 1

An alternative is to just include the facet values as shown in the source records. In this case the Solr index records would be:

ID Facet
1 A
2 B
3 C
4 D

Then in the UI, the counts per facet value would be:

Facet query n
A facet:(A OR B OR C OR D) 4
B facet:B 1
C facet:(C OR D) 2
D facet:D 1