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

Catalog/Search: ordering is broken #615

Open
diegonc opened this issue Sep 18, 2023 · 1 comment
Open

Catalog/Search: ordering is broken #615

diegonc opened this issue Sep 18, 2023 · 1 comment

Comments

@diegonc
Copy link

diegonc commented Sep 18, 2023

The following URL gives a 400 error when trying to search the catalog:

https://demo.moqui.org/qapps/PopcAdmin/Catalog/Search?orderByField=-pseudoId&pageSize=20&queryString=*

Apparently, the service org.moqui.search.SearchServices.search#DataDocuments does not take into account fields that
have a keyword subfield to allow ordering.

The only place where .keyword is appended is here, in moqui-framework, but it seems it's not used by the search service.

@diegonc
Copy link
Author

diegonc commented Sep 18, 2023

BTW I first found this issue in a custom product based DataDocument where pseudoId is a Sortable field. I checked that the keyword subfield is actually generated and the ordering doesn't work.

After posting this issue, I realized that, in MantleProduct, pseudoId is not sortable.

And a workaround I found is to populate the mappings of the index with a field of keyword type ({"properties":{"pseudoId":{"type": "keyword}}}) before running the feed index process. But I'd prefer if the search service could handle the keword subfield of sortable columns of the data document-

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

No branches or pull requests

1 participant