
SolrDocument::sort를 사용하여 문서를 정렬할 때, sort order를 설정하는 방법은 다음과 같습니다.
- 오름차순 정렬: SolrDocument::ASC
- 내림차순 정렬: SolrDocument::DESC
위 코드에서 field1을 내림차순으로 정렬하고 싶다면, 다음과 같이 설정할 수 있습니다.
#hostingforum.kr
php
$sort = new SolrDocument::sort('field1', SolrDocument::DESC);
여러 필드를 사용하여 정렬하는 방법은 다음과 같습니다.
#hostingforum.kr
php
$sort = new SolrDocument::sort('field1', SolrDocument::ASC);
$sort->addSort('field2', SolrDocument::DESC);
이러한 방법으로 여러 필드를 사용하여 정렬할 수 있습니다.
2025-03-26 01:18