How to do pagination with grouping in solr search











up vote
0
down vote

favorite












Document structure of solr document is as mentioned below now i need to extract the document having event_name="product view" and group it by email so that email is not duplicate.Now on listing the email how may paginate the unique email.As the query return total number of document not the count of groups



"docs":[
{
"id":"1",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["yyy"],
"created":123444,
"event_name":"product viewed",
"event_property":"product",
"event_value":"sun glassed",
"_version_":1617201602734587904,
"location_str":["yyyy"]
},
{
"id":"4",
"email":"xxxxxx@gmail.com",
"gender":"F",
"location":["zzzz"],
"created":123447,
"event_name":"Add To Cart",
"event_property":"Name",
"event_value":"sun glasses",
"_version_":1617202784870858752,
"location_str":["zzzz"]
},
{
"id":"5",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["kkkkk"],
"created":123464,
"event_name":"Product Clicked",
"event_property":"Category",
"event_value":"Contact Lens",
"_version_":1617202784871907328,
"location_str":["lllll"]
}
]









share|improve this question
























  • So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
    – MatsLindh
    yesterday















up vote
0
down vote

favorite












Document structure of solr document is as mentioned below now i need to extract the document having event_name="product view" and group it by email so that email is not duplicate.Now on listing the email how may paginate the unique email.As the query return total number of document not the count of groups



"docs":[
{
"id":"1",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["yyy"],
"created":123444,
"event_name":"product viewed",
"event_property":"product",
"event_value":"sun glassed",
"_version_":1617201602734587904,
"location_str":["yyyy"]
},
{
"id":"4",
"email":"xxxxxx@gmail.com",
"gender":"F",
"location":["zzzz"],
"created":123447,
"event_name":"Add To Cart",
"event_property":"Name",
"event_value":"sun glasses",
"_version_":1617202784870858752,
"location_str":["zzzz"]
},
{
"id":"5",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["kkkkk"],
"created":123464,
"event_name":"Product Clicked",
"event_property":"Category",
"event_value":"Contact Lens",
"_version_":1617202784871907328,
"location_str":["lllll"]
}
]









share|improve this question
























  • So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
    – MatsLindh
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Document structure of solr document is as mentioned below now i need to extract the document having event_name="product view" and group it by email so that email is not duplicate.Now on listing the email how may paginate the unique email.As the query return total number of document not the count of groups



"docs":[
{
"id":"1",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["yyy"],
"created":123444,
"event_name":"product viewed",
"event_property":"product",
"event_value":"sun glassed",
"_version_":1617201602734587904,
"location_str":["yyyy"]
},
{
"id":"4",
"email":"xxxxxx@gmail.com",
"gender":"F",
"location":["zzzz"],
"created":123447,
"event_name":"Add To Cart",
"event_property":"Name",
"event_value":"sun glasses",
"_version_":1617202784870858752,
"location_str":["zzzz"]
},
{
"id":"5",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["kkkkk"],
"created":123464,
"event_name":"Product Clicked",
"event_property":"Category",
"event_value":"Contact Lens",
"_version_":1617202784871907328,
"location_str":["lllll"]
}
]









share|improve this question















Document structure of solr document is as mentioned below now i need to extract the document having event_name="product view" and group it by email so that email is not duplicate.Now on listing the email how may paginate the unique email.As the query return total number of document not the count of groups



"docs":[
{
"id":"1",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["yyy"],
"created":123444,
"event_name":"product viewed",
"event_property":"product",
"event_value":"sun glassed",
"_version_":1617201602734587904,
"location_str":["yyyy"]
},
{
"id":"4",
"email":"xxxxxx@gmail.com",
"gender":"F",
"location":["zzzz"],
"created":123447,
"event_name":"Add To Cart",
"event_property":"Name",
"event_value":"sun glasses",
"_version_":1617202784870858752,
"location_str":["zzzz"]
},
{
"id":"5",
"email":"xxxxxx@gmail.com",
"gender":"M",
"location":["kkkkk"],
"created":123464,
"event_name":"Product Clicked",
"event_property":"Category",
"event_value":"Contact Lens",
"_version_":1617202784871907328,
"location_str":["lllll"]
}
]






solr






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Abhijit Bashetti

4,21652033




4,21652033










asked 2 days ago









user3539626

1913




1913












  • So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
    – MatsLindh
    yesterday


















  • So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
    – MatsLindh
    yesterday
















So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
– MatsLindh
yesterday




So what's your query? Are you using grouping already? The group.ngroups parameter tells Solr to include the total group count in the result set in that case.
– MatsLindh
yesterday

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372530%2fhow-to-do-pagination-with-grouping-in-solr-search%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372530%2fhow-to-do-pagination-with-grouping-in-solr-search%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

ts Property 'filter' does not exist on type '{}'

mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window