-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
fxprunayre
merged 6 commits into
geonetwork:3.0.x
from
fxprunayre:improvement/facet-hierachy
Aug 9, 2015
Merged
Facet / Add hierarchical facet support - client side #1133
fxprunayre
merged 6 commits into
geonetwork:3.0.x
from
fxprunayre:improvement/facet-hierachy
Aug 9, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Looks good |
fxprunayre
pushed a commit
that referenced
this pull request
Aug 9, 2015
Facet / Add hierarchical facet support - client side
@@ -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)); |
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This commit add the client side support for it, which means:
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:
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 !