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

Search / Autocomplete / Improvements #6555

Merged
merged 10 commits into from Oct 10, 2022

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented Sep 20, 2022

Display resource type icon.

In catalogues containing various types of records (eg. datasets, series, services, tabular data, applications, models ...) add the type icon indicator to the suggestion list to help user focus on particular type of records.

image

This can be disabled by removing autocompleteConfig._source. To enabled it, set it to:

  "_source": ['resourceTitle*', 'resourceType'],

Suggestion size

Also add the possibility to set the number of suggestions using autocompleteConfig.size.

Suggestion and sorting

  • Scoring, also promote a bit more series by default.
  • Add support for multiple sort fields (eg. resourceType and title)

image

          sortBy: "resourceType,resourceTitleObject.default.keyword",
          sortOrder: "asc,asc"* Record history / UUID filter (was not migrated to Elasticsearch)

![image](https://user-images.githubusercontent.com/1701393/192487383-2ccbf20a-c237-4dec-8606-52d06ccbc94a.png)

gnSuggest directive to easily choose a record

Make more consistent record selection in admin console for various settings:

  • Settings / Preferred template (sorted by type and then title)
  • CSW settings / Record for capability
  • Source settings / Record for capability

Before:
image

After:
image

  • Record history / UUID filter (was not migrated to Elasticsearch)

image

Misc.

  • Add support for "*" to trigger suggestion

image

  • Improve performance of autocomplete query by only retrieving the required fields.
  • Search / Fix wrong order when sortOrder was set to ""

In catalogues containing various types of records (eg. datasets, series, services, tabular data, applications, models ...) add the type icon indicator to the suggestion list to help user focus on particular type of records.

This can be disabled by removing `autocompleteConfig._source`. Default
value is:

```js
  "_source": ['resourceTitle*', 'resourceType'],
```

Also add the possibility to set the number of suggestions using `autocompleteConfig.size`.

Improve performance of autocomplete query by only retrieving the
required fields.

Scoring, also promote a bit more series by default.
@fxprunayre fxprunayre added this to the 4.2.2 milestone Sep 20, 2022
@fxprunayre fxprunayre force-pushed the 422-autocomplete-with-resourcetypeicon branch from 80ec3ca to 52d4a76 Compare September 22, 2022 07:14
We may use autocomplete on record with no resourceType eg. directory entry
@fxprunayre fxprunayre changed the title Search / Autocomplete / Display resource type icon. Search / Autocomplete / Improvements Sep 27, 2022
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@MichelGabriel MichelGabriel self-requested a review October 3, 2022 14:58
Copy link
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

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

For me works in the search UI, but doesn't work in the CSW settings page: http://localhost:8080/geonetwork/srv/eng/admin.console#/settings/csw

csw-settings

Same happens in the Settings page, maybe the directive is not included in the admin bundle?

@josegar74
Copy link
Member

@fxprunayre, tested with the updated code, it works in the previous pages, but I see a failing request, that without this pull request doesn't occur, so should be related:

http://localhost:8080/geonetwork/srv/api/search/records/_search

{
"servlet":"spring",
"message":"Error is: Bad Request.\nRequest:\n{"query":{"bool":{"must":[{"multi_match":{"fields":["id","uuid"]}},{"terms":{"isTemplate":["y","n","s"]}},{"terms":{"draft":["n","y","e"]}}],"filter":{"query_string":{"query":"*:*"}}}}}\n.\nError:\n{"error":{"root_cause":[{"type":"parsing_exception","reason":"No text specified for multi_match query","line":1,"col":65}],"type":"x_content_parse_exception","reason":"[1:65] [bool] failed to parse field [must]","caused_by":{"type":"parsing_exception","reason":"No text specified for multi_match query","line":1,"col":65}},"status":400}.",
"url":"/geonetwork/srv/api/search/records/_search",
"status":"400"
}

@fxprunayre
Copy link
Member Author

Indeed @josegar74 some issue with null or empty string check. Should be better now.

@josegar74
Copy link
Member

@fxprunayre no errors now, but in the Sources page I get suggested also the templates, in the CSW page it looks fine.

Sources page:

sources-suggestions

CSW page:

csw-suggestions

@fxprunayre
Copy link
Member Author

@fxprunayre no errors now, but in the Sources page I get suggested also the templates, in the CSW page it looks fine.

Fixed.

@fxprunayre fxprunayre merged commit fd70300 into main Oct 10, 2022
@fxprunayre fxprunayre deleted the 422-autocomplete-with-resourcetypeicon branch October 10, 2022 15:48
josegar74 added a commit to osgeonl/geonetwork-dutch-skin that referenced this pull request Oct 12, 2022
josegar74 added a commit to GeoCat/core-geonetwork that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants