Yes we tried using another page to render updated result using with Ajax, also used with renderPartial.
Also here there is no model to provide data as we use Solr for search and passing data using [color="#1C2837"][size="2"]CArrayDataProvider.[/size][/color]
A very basic question, but didn’t you try to optimize the Solr query by peeking the pagination parameters?
Usually we have to supply all the raw data to the CArrayDataProvider without ‘offset’ and ‘limit’, otherwise CArrayDataProvider can’t sort or paginate the given raw data.
No we use dynamic param to get data from Solr, We haven’t use to obtain whole data as we had Millions of record from which we had to search result with keyword.
We use below code (Just for example, Don’t much go through it),
//Prepare fq query
$stringjoin='';
if(isset($facet_min) && isset($facet_max) && !isset($stringstore) && empty($stringstore)){
$stringjoin.="priceTot:[".$facet_min ." TO " .$facet_max."]";
}elseif(isset($facet_min) && isset($facet_max) && isset($stringstore) && !empty($stringstore)){
$stringjoin.="priceTot:[".$facet_min ." TO " .$facet_max."] AND ".$stringstore; //OR replace with AND
}
//End Prepare fq query
$additionalParameters = array(
'facet' => 'true',
'indent' => 'true',
//'fq'=>"priceTot:[".$facet_min ." TO " .$facet_max."]",
'fq'=>$stringjoin,
);
I mean, the raw data should be filtered according to the conditions, but you have to supply all the filtered data without offset and limit. When the filter gives you 500 items as a whole, then you should give them as the raw data.
You might want to supply just the necessary number of items for the page:
From 1 to 20 for the 1st page
From 21 to 40 for the 2nd page
…
But this optimization works only for the 1st page.
Yes but we don’t get page number param in ajax post method.
The problem posted in first post is,
[size="2"][color="#000080"]First time on search with keyword it works as charm also with pagination (shows total 300 data) .[/color][/size]
[color="#000080"][size="2"]After that when I apply filter ( i.e Price Range… … ) using another ajaxPage it works fine (shows total 100 data) but… … …[/size][/color]
[size="2"][color="#000080"]On clicking pagination It just show previous list ( show total 300 data ) OR with some modification it gives NULL data.[/color][/size]
[size="2"] [/size]
[size=“2”][color="#000080"]First time using Solr with Yii [/color][/size]