Re: [dspace-tech] Help with SOLR direct query
Hi, You were right about this. Thank you for that. Going back to the original problem, I've found that I don't really need to join indexes to get the "top 5 visited items by collection". For that, I use a pivot.facet inside the statistics index, and that gives me what I want: For a certain community, I get the top five most visited items for every collection inside the community. Here the query for the community 251: http://localhost:1234/solr/statistics/select?q=type:2&fq=owningComm:251&sort=id+asc&rows=0&fl=id&wt=xml&indent=true&facet=true&facet.pivot=owningColl,id&omitHeader=true&f.id.facet.limit=5 Besides, I've found that using join queries I can't get results from both indexes -search and statistics-. I can use the join queries for filtering results but, for example, if I join with the search index, in order to get the handle of an item, and then I get the statistics hits of that item, I can't retrieve the handle. So, either I get the statistics hits or I get the handle of a certain item. ¿How could I get both in a single query? Regards, On Tuesday, September 13, 2016 at 2:05:43 PM UTC+2, helix84 wrote: > > Not sure why it's failing but the innocuously looking "and" seems to > be the culprit. You can leave it out as "and" is the default for the > statistics core anyway[1]: > > > http://localhost:1234/solr/statistics/select?q=type:4+id:251&fq=statistics_type:view&fq=-isBot:true&fl=uid+score+&df=id&wt=xml&indent=true&facet=true&facet.field=id > > > [1] > https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace/solr/statistics/conf/schema.xml#L339 > > > > Regards, > ~~helix84 > > Compulsory reading: DSpace Mailing List Etiquette > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > > > On Tue, Sep 13, 2016 at 1:49 PM, Rafa Carreres > wrote: > > Thank you Helix, > > > > Now, I am doing some progress. > > First, I find all the items under a certain community, let's say, > community > > 251. > > With this query > > > http://localhost:1234/solr/search/select?q=search.resourcetype:2+and+location.comm:251&fq=discoverable:true&fq=withdrawn:false&fl=search.uniqueid+handle+location.coll&wt=csv&indent=true > > > > > I get some results: > > > > search.uniqueid,handle,location.coll > > 2-19076,10045/16013,"1684,1024,545" > > 2-19074,10045/16011,1684 > > 2-19077,10045/16014,1684 > > 2-15382,10045/13384,1367 > > 2-28824,10045/23756,731 > > 2-32318,10045/26477,3395 > > 2-33005,10045/26958,3395 > > 2-32309,10045/26471,3395 > > 2-32312,10045/26473,3395 > > 2-32311,10045/26472,3395 > > > > etc > > > > > > > > > > Now, for a the same community I am trying to get the stastistics hits > but I > > don't know how to. > > > > I've tried this query but with no results: > > > http://localhost:1234/solr/statistics/select?q=type:4+and+id:251&fq=statistics_type:view&fq=-isBot:true&fl=uid+score+&df=id&wt=xml&indent=true&facet=true&facet.field=id > > > > > Here is the output: > > > > > > > > > > > > > > 0 > > 3 > > > > type:2 and id:19076 > > id > > id > > true > > uid, score > > > > statistics_type:view > > -isBot:true > > > > xml > > true > > 1473766954959 > > > > > > > > > > > > > > > > > > 0 > > 0 > > 0 > > 0 > > 0 > > 0 > > 0 > > 0 > > > > > > > 0 > > > > 0 > > > > > > > > > > > > > > > > > > > > What am I doing wrong? > > > > > > Regards, > > > > > > > > On Friday, September 9, 2016 at 3:18:20 PM UTC+2, helix84 wrote: > >> > >> You'll find general information about direct Solr queries on this wiki > >> page: > >> > >> https://wiki.duraspace.org/display/DSPACE/Solr > >> > >> Also, two of the example queries can be combined to give you almost > >> the exact answer you want. The thing is that the statistics data > >> resides in a different index (statistics) than the hierarchy data > >> (search), so either do the combining in the code running the query or > >> look into "Multicore join queries", also mentioned on that wiki page. > >> > >> > >> Regards, > >> ~~helix84 > >> > >> Compulsory reading: DSpace Mailing List Etiquette > >> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > >> > >> > >> > >> On Fri, Sep 9, 2016 at 3:10 PM, Rafa Carreres > wrote: > >> > Hi, > >> > > >> > I need to find out by means of a SOLR direct query "Top 5 of most > viewed > >> > items in a certain collection or community". > >> > > >> > It doesn't look like a complicated query but I have no idea about > this. > >> > Besides, I've found it hard to get information about direct SOLR > >> > queries. > >> > > >> > I would really appreciate some help. > >> > > >> > Regards, > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> >
Re: [dspace-tech] Help with SOLR direct query
Not sure why it's failing but the innocuously looking "and" seems to be the culprit. You can leave it out as "and" is the default for the statistics core anyway[1]: http://localhost:1234/solr/statistics/select?q=type:4+id:251&fq=statistics_type:view&fq=-isBot:true&fl=uid+score+&df=id&wt=xml&indent=true&facet=true&facet.field=id [1] https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace/solr/statistics/conf/schema.xml#L339 Regards, ~~helix84 Compulsory reading: DSpace Mailing List Etiquette https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette On Tue, Sep 13, 2016 at 1:49 PM, Rafa Carreres wrote: > Thank you Helix, > > Now, I am doing some progress. > First, I find all the items under a certain community, let's say, community > 251. > With this query > http://localhost:1234/solr/search/select?q=search.resourcetype:2+and+location.comm:251&fq=discoverable:true&fq=withdrawn:false&fl=search.uniqueid+handle+location.coll&wt=csv&indent=true > > I get some results: > > search.uniqueid,handle,location.coll > 2-19076,10045/16013,"1684,1024,545" > 2-19074,10045/16011,1684 > 2-19077,10045/16014,1684 > 2-15382,10045/13384,1367 > 2-28824,10045/23756,731 > 2-32318,10045/26477,3395 > 2-33005,10045/26958,3395 > 2-32309,10045/26471,3395 > 2-32312,10045/26473,3395 > 2-32311,10045/26472,3395 > > etc > > > > > Now, for a the same community I am trying to get the stastistics hits but I > don't know how to. > > I've tried this query but with no results: > http://localhost:1234/solr/statistics/select?q=type:4+and+id:251&fq=statistics_type:view&fq=-isBot:true&fl=uid+score+&df=id&wt=xml&indent=true&facet=true&facet.field=id > > Here is the output: > > > > > > > 0 > 3 > > type:2 and id:19076 > id > id > true > uid, score > > statistics_type:view > -isBot:true > > xml > true > 1473766954959 > > > > > > > > > 0 > 0 > 0 > 0 > 0 > 0 > 0 > 0 > > > 0 > > 0 > > > > > > > > > > What am I doing wrong? > > > Regards, > > > > On Friday, September 9, 2016 at 3:18:20 PM UTC+2, helix84 wrote: >> >> You'll find general information about direct Solr queries on this wiki >> page: >> >> https://wiki.duraspace.org/display/DSPACE/Solr >> >> Also, two of the example queries can be combined to give you almost >> the exact answer you want. The thing is that the statistics data >> resides in a different index (statistics) than the hierarchy data >> (search), so either do the combining in the code running the query or >> look into "Multicore join queries", also mentioned on that wiki page. >> >> >> Regards, >> ~~helix84 >> >> Compulsory reading: DSpace Mailing List Etiquette >> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette >> >> >> >> On Fri, Sep 9, 2016 at 3:10 PM, Rafa Carreres wrote: >> > Hi, >> > >> > I need to find out by means of a SOLR direct query "Top 5 of most viewed >> > items in a certain collection or community". >> > >> > It doesn't look like a complicated query but I have no idea about this. >> > Besides, I've found it hard to get information about direct SOLR >> > queries. >> > >> > I would really appreciate some help. >> > >> > Regards, >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "DSpace Technical Support" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to dspace-tech...@googlegroups.com. >> > To post to this group, send email to dspac...@googlegroups.com. >> > Visit this group at https://groups.google.com/group/dspace-tech. >> > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscr...@googlegroups.com. To post to this group, send email to dspace-tech@googlegroups.com. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
Re: [dspace-tech] Help with SOLR direct query
Thank you Helix, Now, I am doing some progress. First, I find all the items under a certain community, let's say, community 251. With this query http://localhost:1234/solr/search/select?q=search.resourcetype:2+and+location.comm:251&fq=discoverable:true&fq=withdrawn:false&fl=search.uniqueid+handle+location.coll&wt=csv&indent=true I get some results: search.uniqueid,handle,location.coll 2-19076,10045/16013,"1684,1024,545" 2-19074,10045/16011,1684 2-19077,10045/16014,1684 2-15382,10045/13384,1367 2-28824,10045/23756,731 2-32318,10045/26477,3395 2-33005,10045/26958,3395 2-32309,10045/26471,3395 2-32312,10045/26473,3395 2-32311,10045/26472,3395 etc Now, for a the same community I am trying to get the stastistics hits but I don't know how to. I've tried this query but with no results: http://localhost:1234/solr/statistics/select?q=type:4+and+id:251&fq=statistics_type:view&fq=-isBot:true&fl=uid+score+&df=id&wt=xml&indent=true&facet=true&facet.field=id Here is the output: 0 3 type:2 and id:19076 id id true uid, score statistics_type:view -isBot:true xml true 1473766954959 0 0 0 0 0 0 0 00 0 What am I doing wrong? Regards, On Friday, September 9, 2016 at 3:18:20 PM UTC+2, helix84 wrote: > > You'll find general information about direct Solr queries on this wiki > page: > > https://wiki.duraspace.org/display/DSPACE/Solr > > Also, two of the example queries can be combined to give you almost > the exact answer you want. The thing is that the statistics data > resides in a different index (statistics) than the hierarchy data > (search), so either do the combining in the code running the query or > look into "Multicore join queries", also mentioned on that wiki page. > > > Regards, > ~~helix84 > > Compulsory reading: DSpace Mailing List Etiquette > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > > > > On Fri, Sep 9, 2016 at 3:10 PM, Rafa Carreres > wrote: > > Hi, > > > > I need to find out by means of a SOLR direct query "Top 5 of most viewed > > items in a certain collection or community". > > > > It doesn't look like a complicated query but I have no idea about this. > > Besides, I've found it hard to get information about direct SOLR > queries. > > > > I would really appreciate some help. > > > > Regards, > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "DSpace Technical Support" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to dspace-tech...@googlegroups.com . > > To post to this group, send email to dspac...@googlegroups.com > . > > Visit this group at https://groups.google.com/group/dspace-tech. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscr...@googlegroups.com. To post to this group, send email to dspace-tech@googlegroups.com. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
Re: [dspace-tech] Help with SOLR direct query
You'll find general information about direct Solr queries on this wiki page: https://wiki.duraspace.org/display/DSPACE/Solr Also, two of the example queries can be combined to give you almost the exact answer you want. The thing is that the statistics data resides in a different index (statistics) than the hierarchy data (search), so either do the combining in the code running the query or look into "Multicore join queries", also mentioned on that wiki page. Regards, ~~helix84 Compulsory reading: DSpace Mailing List Etiquette https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette On Fri, Sep 9, 2016 at 3:10 PM, Rafa Carreres wrote: > Hi, > > I need to find out by means of a SOLR direct query "Top 5 of most viewed > items in a certain collection or community". > > It doesn't look like a complicated query but I have no idea about this. > Besides, I've found it hard to get information about direct SOLR queries. > > I would really appreciate some help. > > Regards, > > -- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to dspace-tech+unsubscr...@googlegroups.com. > To post to this group, send email to dspace-tech@googlegroups.com. > Visit this group at https://groups.google.com/group/dspace-tech. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscr...@googlegroups.com. To post to this group, send email to dspace-tech@googlegroups.com. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.