Re: Date Faceting on Solr 3.1
Thanks Hoss. Whatever you described does make sense, however we are migrating over from FAST and the date range buckets work differently there. The expectations of the business users are based on the existing system. I need to reset their expectations ;-) ... Thanks for the very detailed explanation. -- karthik On Sun, Sep 4, 2011 at 7:54 PM, Chris Hostetter hossman_luc...@fucit.orgwrote: : Can solr take the earliest date from the result set to be the value for : facet.date.start? I dont want to have the value 1/1/1995 hardcoded in my : application since a new data feed that gets into my index could be older : than 1995 and i might keep missing them from the facet. no, you have to pick a start and end date. In most use cases, people pick a start date and gap size that is some convinient order of magnitutde relative the time ranges they wnat to deal in. ie: I want to let people facet by year for the past 10 years that woud result in... facet.date.start=NOW/YEAR-1YEAR facet.date.gap=+1YEAR facet.date.end=NOW/YEAR+1YEAR ...likewise you could said I want to let people facet by month for the past year etc... where facet.date.other and before/after come in handy is to people able to tell your users here are hte facet counts for each year of hte past 10 years, and there are X documents odler then that If people want to see older documents, then you can refine your start/end (and maybe even gap) to show them facets for those older years (maybe you keep a gap of 1YEAR and just shift the start, maybe you switch to a gap of 10YEARS and use a start that's 100 years ago?) Solr Faceting doesn't offer a means to pick the lowest value in the index, because it's usually either: 1) something useful, but you already know that and know what it is and can easily configure it manually (ie: 1995 for you) 2) something so useless it would provide a terrible usecase if it was used by default so you really have to configure it manually (ie: if your docs span hundrads of years and you want to show counts per month it would be painful to show every month for the past 500 years by default) 3) something that fluctuates as the index changes and would result in an inconsistent user experience so it would be undesirable (ie: one day you're offering to facet per year for hte past 10 years, the next day you're offering to facet per year for the past 47 years) Note: if you take advatnage of the key localparam, you can facet on the same field with multiple date ranges (ie: facet per year for the last 10 years, and facet per decade for the past 100 years) in a single request -- so that might come in handy for you... https://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key -Hoss
Re: Date Faceting on Solr 3.1
Hi, Note that if you want more control over the buckets, you may use facet.query instead. Also, under development is SOLR-2366 which will eventually give a more powerful gap specification to range facets. -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com Solr Training - www.solrtraining.com On 6. sep. 2011, at 22:44, karthik wrote: Thanks Hoss. Whatever you described does make sense, however we are migrating over from FAST and the date range buckets work differently there. The expectations of the business users are based on the existing system. I need to reset their expectations ;-) ... Thanks for the very detailed explanation. -- karthik On Sun, Sep 4, 2011 at 7:54 PM, Chris Hostetter hossman_luc...@fucit.orgwrote: : Can solr take the earliest date from the result set to be the value for : facet.date.start? I dont want to have the value 1/1/1995 hardcoded in my : application since a new data feed that gets into my index could be older : than 1995 and i might keep missing them from the facet. no, you have to pick a start and end date. In most use cases, people pick a start date and gap size that is some convinient order of magnitutde relative the time ranges they wnat to deal in. ie: I want to let people facet by year for the past 10 years that woud result in... facet.date.start=NOW/YEAR-1YEAR facet.date.gap=+1YEAR facet.date.end=NOW/YEAR+1YEAR ...likewise you could said I want to let people facet by month for the past year etc... where facet.date.other and before/after come in handy is to people able to tell your users here are hte facet counts for each year of hte past 10 years, and there are X documents odler then that If people want to see older documents, then you can refine your start/end (and maybe even gap) to show them facets for those older years (maybe you keep a gap of 1YEAR and just shift the start, maybe you switch to a gap of 10YEARS and use a start that's 100 years ago?) Solr Faceting doesn't offer a means to pick the lowest value in the index, because it's usually either: 1) something useful, but you already know that and know what it is and can easily configure it manually (ie: 1995 for you) 2) something so useless it would provide a terrible usecase if it was used by default so you really have to configure it manually (ie: if your docs span hundrads of years and you want to show counts per month it would be painful to show every month for the past 500 years by default) 3) something that fluctuates as the index changes and would result in an inconsistent user experience so it would be undesirable (ie: one day you're offering to facet per year for hte past 10 years, the next day you're offering to facet per year for the past 47 years) Note: if you take advatnage of the key localparam, you can facet on the same field with multiple date ranges (ie: facet per year for the last 10 years, and facet per decade for the past 100 years) in a single request -- so that might come in handy for you... https://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key -Hoss
Re: Date Faceting on Solr 3.1
: Can solr take the earliest date from the result set to be the value for : facet.date.start? I dont want to have the value 1/1/1995 hardcoded in my : application since a new data feed that gets into my index could be older : than 1995 and i might keep missing them from the facet. no, you have to pick a start and end date. In most use cases, people pick a start date and gap size that is some convinient order of magnitutde relative the time ranges they wnat to deal in. ie: I want to let people facet by year for the past 10 years that woud result in... facet.date.start=NOW/YEAR-1YEAR facet.date.gap=+1YEAR facet.date.end=NOW/YEAR+1YEAR ...likewise you could said I want to let people facet by month for the past year etc... where facet.date.other and before/after come in handy is to people able to tell your users here are hte facet counts for each year of hte past 10 years, and there are X documents odler then that If people want to see older documents, then you can refine your start/end (and maybe even gap) to show them facets for those older years (maybe you keep a gap of 1YEAR and just shift the start, maybe you switch to a gap of 10YEARS and use a start that's 100 years ago?) Solr Faceting doesn't offer a means to pick the lowest value in the index, because it's usually either: 1) something useful, but you already know that and know what it is and can easily configure it manually (ie: 1995 for you) 2) something so useless it would provide a terrible usecase if it was used by default so you really have to configure it manually (ie: if your docs span hundrads of years and you want to show counts per month it would be painful to show every month for the past 500 years by default) 3) something that fluctuates as the index changes and would result in an inconsistent user experience so it would be undesirable (ie: one day you're offering to facet per year for hte past 10 years, the next day you're offering to facet per year for the past 47 years) Note: if you take advatnage of the key localparam, you can facet on the same field with multiple date ranges (ie: facet per year for the last 10 years, and facet per decade for the past 100 years) in a single request -- so that might come in handy for you... https://wiki.apache.org/solr/SimpleFacetParameters#key_:_Changing_the_output_key -Hoss
Date Faceting on Solr 3.1
Hi Everyone, I am trying to configure date faceting on Solr 3.1. I browsed through the wiki and understood how to enable and configure it. To explain this better, lets take an example - my index has docs with dates ranging from 01/01/1995 until NOW (ie., today) as of now. To configure date facet I need to provide these 3 parameters - facet.date.start - i really dont want to give 1/1/1995 as the start date .. facet.date.end - i can specify this as NOW facet.date.gap - i would really like to keep this as 2 years at the max Can solr take the earliest date from the result set to be the value for facet.date.start? I dont want to have the value 1/1/1995 hardcoded in my application since a new data feed that gets into my index could be older than 1995 and i might keep missing them from the facet. However i did see that there was another field called facet.date.other that is intended to include edge cases. I see the option before would some what solve my problem but would like to see if there are any alternatives. Thanks -- karthik