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

Make Sort order configurable #20

Closed
cbleek opened this issue Jul 17, 2019 · 2 comments
Closed

Make Sort order configurable #20

cbleek opened this issue Jul 17, 2019 · 2 comments
Assignees

Comments

@cbleek
Copy link
Member

cbleek commented Jul 17, 2019

Currently, the sort order is hardcoded descending by date.

We want to make this configurable. For example this would make the

< $randString = rand(1,100);
< $query->addSortField('random'.$randString, SolrQuery::ORDER_DESC);

@TiSiE
Copy link
Member

TiSiE commented Jul 17, 2019

The configurable sort order should only be applied when an "empty search" is performed.

} else {
$q = '*:*';
$query->addSortField('datePublishStart', SolrQuery::ORDER_DESC);
}

Analogous to #19, there should be an array value in the ModuleOptions to allow specifiying one or more sort orders. The currently harcoded one should stay the default choice, if nothing is configured.

Possible options array could be

[
    'fieldName' => SolrQuery::ORDER_ASC,
    'secondField' => SolrQuery::ORDER_DESC,
];

or an array of arrays

[
    ['fieldName', SolrQuery::ORDER_ASC],
]

@TiSiE
Copy link
Member

TiSiE commented Jul 17, 2019

@kilip It would be great if you could do it.

Please note, that the default branch was changed to 'master'

@kilip kilip self-assigned this Jul 21, 2019
@TiSiE TiSiE closed this as completed in 79ebc5b Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants