File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Model/Resolver/Products/DataProvider Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,27 @@ public function getList(
123123 //Create a copy of search criteria without filters to preserve the results from search
124124 $ searchCriteriaForCollection = $ this ->searchCriteriaBuilder ->build ($ searchCriteria );
125125 //Apply CatalogSearch results from search and join table
126- // $this->getSearchResultsApplier(
127- // $searchResult,
128- // $collection,
129- // $this->getSortOrderArray($searchCriteriaForCollection)
130- // )->apply();
126+ if (!empty ($ searchResult ) && $ searchResult ->getItems ()) {
127+ $ items = [];
128+ foreach ($ searchResult ->getItems () as $ _item ) {
129+ if (get_class ($ _item ) == "Smile \\ElasticsuiteCore \\Search \\Adapter \\Elasticsuite \\Response \\Document " ) {
130+ $ score = $ _item ->getCustomAttribute ('score ' );
131+ if (!$ score ) {
132+ $ _item ->setCustomAttribute ('score ' , '' );
133+ }
134+ $ items [] = $ _item ;
135+ }
136+ }
137+ if (!empty ($ items )) {
138+ $ searchResult ->setItems ($ items );
139+ }
140+
141+ $ this ->getSearchResultsApplier (
142+ $ searchResult ,
143+ $ collection ,
144+ $ this ->getSortOrderArray ($ searchCriteriaForCollection )
145+ )->apply ();
146+ }
131147
132148 $ collection ->setFlag ('search_resut_applied ' , true );
133149
You can’t perform that action at this time.
0 commit comments