Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facet / Add hierarchical facet support - client side #1133

Merged
merged 6 commits into from
Aug 9, 2015

Conversation

fxprunayre
Copy link
Member

Hierarchical facet support was added in #680
providing server code to handle facet hierarchy based on thesaurus broader relations.

This PR add the client side interface.

image

This commit add the client side support for it, which means:

  • add directive to handle facet response using the dimension format ie.
    • example for flat facet
<summary count="3949" type="local">
  <dimension name="type" label="types">
    <category value="dataset" label="Dataset" count="3043"/>
    <category value="series" label="Series" count="408"/>
...
  • example for hierachical facet
<category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00025/" label="World" count="110">
  <category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00005/" label="Atlantic Ocean" count="13">
    <category value="http://vocab.nerc.ac.uk/collection/C19/current/1/" label="North Atlantic Ocean" count="13">
      <category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00015/" label="Northeast Atlantic Ocean (40W)" count="13">
        <category value="http://vocab.nerc.ac.uk/collection/C19/current/1_7/" label="English Channel" count="12"/>
        <category value="http://vocab.nerc.ac.uk/collection/C19/current/1_8/" label="Bay of Biscay" count="3"/>
....
  • old facet format is still supported but it sounds relevant to deprecate it at some point and progressively move to the dimension format. Search and Editor board apps are migrated to the dimension format.
  • add example to know how to configure hierarchical facet using the regions thesaurus provided by GeoNetwork or the GEMET thesaurus.
  • Default configuration is similar to previous one (ie. summaryTypes = hits) providing only one level facets.
  • Facet can be collapsed

For example, a catalog harvesting Ifremer Sextant, EEA catalog and GrandLyon and analyzing all metadata keywords against GEMET thesaurus will create the following tree which could be used to easily filter catalog content:

image

This work was also tested with the updated regions thesaurus (see #1113).

This work was supported by EEA. Thanks to @jonescc for hints on drilldown query !

François Prunayre added 6 commits August 3, 2015 17:37
Query with drilldown  http://localhost:8080/geonetwork/srv/eng/q?facet.q=topicCat%2Fstructure&resultType=details& return 0
Query on field http://localhost:8080/geonetwork/srv/eng/q?topicCat=structure&resultType=details& return 1 record.

The field is properly indexed but the facet does not refer to it. To workaround the issue, drilldown should be made on the field with local suffix (which the client side does not know about http://localhost:8080/geonetwork/srv/eng/q?facet.q=topicCat_eng%2Fstructure&resultType=details&

Add all value to the indexKey dimension so that user can use a language specific drilldown path or the main field in the index.
Hierarchical facet support was added in geonetwork#680
providing server code to handle facet hierarchy based on thesaurus broader relations.

This commit add the client side support for it, which means:
* add directive to handle facet response using the dimension format ie.
 * example for flat facet
```
<summary count="3949" type="local">
  <dimension name="type" label="types">
    <category value="dataset" label="Dataset" count="3043"/>
    <category value="series" label="Series" count="408"/>
...
```
 * example for hierachical facet
```
<category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00025/" label="World" count="110">
  <category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00005/" label="Atlantic Ocean" count="13">
    <category value="http://vocab.nerc.ac.uk/collection/C19/current/1/" label="North Atlantic Ocean" count="13">
      <category value="http://vocab.nerc.ac.uk/collection/C19/current/SVX00015/" label="Northeast Atlantic Ocean (40W)" count="13">
        <category value="http://vocab.nerc.ac.uk/collection/C19/current/1_7/" label="English Channel" count="12"/>
        <category value="http://vocab.nerc.ac.uk/collection/C19/current/1_8/" label="Bay of Biscay" count="3"/>
....
```
* old facet format is still supported but it sounds relevant to deprecate it and progressively move to the dimension format. Search and Editor board app are migrated to the dimension format.
* add example to know how to configure hierarchical facet using the regions thesaurus provided by GeoNetwork or the GEMET thesaurus.
@fxprunayre fxprunayre self-assigned this Aug 6, 2015
@fxprunayre fxprunayre added this to the 3.0.2 milestone Aug 6, 2015
@fgravin
Copy link
Member

fgravin commented Aug 7, 2015

Looks good

fxprunayre pushed a commit that referenced this pull request Aug 9, 2015
Facet / Add hierarchical facet support - client side
@fxprunayre fxprunayre merged commit d576b00 into geonetwork:3.0.x Aug 9, 2015
@@ -1588,7 +1588,8 @@ private IndexInformation newDocument(String language, Element xml, Collection<Fi
Classifier classifier = dimension.getClassifier();

for (CategoryPath categoryPath: classifier.classify(value)) {
if (!dimension.isLocalized() || dimension.getLocales().contains(locale)) {
result.add(new FacetField(dimension.getName(), categoryPath.components));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact it breaks indexing because a field and a facet have the same name. I will fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants