You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Stephen Weiss <St...@wgsn.com> on 2017/04/21 15:50:42 UTC

DateRangeField and Faceting

Hi everyone,

Just trying to do a sense check on this.  I'm trying to do a facet based off a DateRangeField and I'm hitting this error:

Error from server at http://172.20.141.150:8983/solr/instock_au_shard1_replica0: Unable to range facet on field:sku_history.date_range{type=daterange,properties=indexed,stored,omitTermFreqAndPositions}


Now I read through FacetRange.java and it seems like only TrieFields are accepted, while DateRangeField is a spatial type, so I suppose that makes sense. However, elsewhere in the codebase under DateCalc (which is essentially the same set of restrictions) it says:

if (! (field.getType() instanceof TrieDateField) ) { throw new IllegalArgumentException("SchemaField must use field type extending TrieDateField or DateRangeField"); }

Is this for some reason assuming that DateRangeField is a subclass of TrieDateField (it isn't)? I also see a mention here of someone doing a facet on a DateRangeField and having it work:

https://wiki.apache.org/solr/DateRangeField

In his case, his daterangefield is multivalued and it seemed to work for him - mine is simpler than that yet it doesn't work. I don't really understand what we're doing differently that matters, and reading the codebase, it really doesn't seem like this was ever possible - but that comment under DateCalc makes me wonder.

If we could facet on the daterangefield, it would be very helpful, so any pointers on how to do that would be welcome.

--
Steve

WGSN (www.wgsn.com) is the world’s leading trend authority for creative thinkers in over 94 countries. Our services cover consumer insights, fashion and lifestyle forecasting, data analytics, crowd-sourced design validation and expert consulting. We help drive our customers to greater success. Together, we Create Tomorrow.

WGSN is part of WGSN Limited, comprising of market-leading products including WGSN Insight, WGSN Fashion, WGSN Instock, WGSN Lifestyle & Interiors, WGSN Styletrial and WGSN Mindset, our bespoke consultancy services. WGSN is owned by Ascential plc, a leading international media company that informs and connects business professionals in 150 countries through market-leading Exhibitions and Festivals, and Information Services.

The information in or attached to this email is confidential and may be legally privileged. If you are not the intended recipient of this message, any use, disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you have received this message in error, please notify the sender immediately by return email and delete this message and any copies from your computer and network.

WGSN does not warrant that this email and any attachments are free from viruses and accepts no liability for any loss resulting from infected email transmissions.

WGSN reserves the right to monitor all email through its networks. Any views expressed may be those of the originator and not necessarily of WGSN. WGSN is powered by Ascential plc, which transforms knowledge businesses to deliver exceptional performance.

Please be advised all phone calls may be recorded for training and quality purposes and by accepting and/or making calls from and/or to us you acknowledge and agree to calls being recorded.

WGSN Limited, Company number 4858491

Registered Address:

Ascential plc, The Prow, 1 Wilder Walk, London W1B 5AP
WGSN Inc., tax ID 04-3851246, registered office c/o National Registered Agents, Inc., 160 Greentree Drive, Suite 101, Dover DE 19904, United States 4C Serviços de Informação Ltda., CNPJ/MF (Taxpayer's Register): 15.536.968/0001-04, Address: Avenida Cidade Jardim, 377, 7˚ andar CEP 01453-000, Itaim Bibi, São Paulo 4C Business Information Consulting (Shanghai) Co., Ltd, 富新商务信息咨询(上海)有限公司, registered address Unit 4810/4811, 48/F Tower 1, Grand Gateway, 1 Hong Qiao Road, Xuhui District, Shanghai

Re: DateRangeField and Faceting

Posted by David Smiley <da...@gmail.com>.
Hi Stephen,

I agree that it would be nice if the JSON faceting module worked with
DateRangeField.  Sadly Solr has several faceting engines (classic, JSON
Facets, analytics contrib) and there has yet been any effort to coral
them.  My sense is that JSON Faceting is where effort should go, and as you
see there are some gaps.

~ David

On Fri, Apr 21, 2017 at 2:47 PM Stephen Weiss <St...@wgsn.com> wrote:

> One small detail - I just realized I've been doing JSON faceting and the
> wiki refers to old-school faceting.  Old-school faceting indeed does work
> but the problem is the facet is ultimately one of a whole tree of stats I'm
> collecting, so JSON facet is far more convenient for my use case (I don't
> think I can even do what I'm doing with old facets).  Why would
> daterangefield work with the old faceting system and not the new?
>
> --
> Steve
>
> On Fri, Apr 21, 2017 at 11:50 AM, Stephen Weiss <Steve.Weiss@wgsn.com
> <ma...@wgsn.com>> wrote:
> Hi everyone,
>
> Just trying to do a sense check on this.  I'm trying to do a facet based
> off a DateRangeField and I'm hitting this error:
>
> Error from server at
> http://172.20.141.150:8983/solr/instock_au_shard1_replica0: Unable to
> range facet on
> field:sku_history.date_range{type=daterange,properties=indexed,stored,omitTermFreqAndPositions}
>
>
> Now I read through FacetRange.java and it seems like only TrieFields are
> accepted, while DateRangeField is a spatial type, so I suppose that makes
> sense. However, elsewhere in the codebase under DateCalc (which is
> essentially the same set of restrictions) it says:
>
> if (! (field.getType() instanceof TrieDateField) ) { throw new
> IllegalArgumentException("SchemaField must use field type extending
> TrieDateField or DateRangeField"); }
>
> Is this for some reason assuming that DateRangeField is a subclass of
> TrieDateField (it isn't)? I also see a mention here of someone doing a
> facet on a DateRangeField and having it work:
>
> https://wiki.apache.org/solr/DateRangeField
>
> In his case, his daterangefield is multivalued and it seemed to work for
> him - mine is simpler than that yet it doesn't work. I don't really
> understand what we're doing differently that matters, and reading the
> codebase, it really doesn't seem like this was ever possible - but that
> comment under DateCalc makes me wonder.
>
> If we could facet on the daterangefield, it would be very helpful, so any
> pointers on how to do that would be welcome.
>
> --
> Steve
>
>
> WGSN (www.wgsn.com) is the world’s leading trend authority for creative
> thinkers in over 94 countries. Our services cover consumer insights,
> fashion and lifestyle forecasting, data analytics, crowd-sourced design
> validation and expert consulting. We help drive our customers to greater
> success. Together, we Create Tomorrow.
>
> WGSN is part of WGSN Limited, comprising of market-leading products
> including WGSN Insight, WGSN Fashion, WGSN Instock, WGSN Lifestyle &
> Interiors, WGSN Styletrial and WGSN Mindset, our bespoke consultancy
> services. WGSN is owned by Ascential plc, a leading international media
> company that informs and connects business professionals in 150 countries
> through market-leading Exhibitions and Festivals, and Information Services.
>
> The information in or attached to this email is confidential and may be
> legally privileged. If you are not the intended recipient of this message,
> any use, disclosure, copying, distribution or any action taken in reliance
> on it is prohibited and may be unlawful. If you have received this message
> in error, please notify the sender immediately by return email and delete
> this message and any copies from your computer and network.
>
> WGSN does not warrant that this email and any attachments are free from
> viruses and accepts no liability for any loss resulting from infected email
> transmissions.
>
> WGSN reserves the right to monitor all email through its networks. Any
> views expressed may be those of the originator and not necessarily of WGSN.
> WGSN is powered by Ascential plc, which transforms knowledge businesses to
> deliver exceptional performance.
>
> Please be advised all phone calls may be recorded for training and quality
> purposes and by accepting and/or making calls from and/or to us you
> acknowledge and agree to calls being recorded.
>
> WGSN Limited, Company number 4858491
>
> Registered Address:
>
> Ascential plc, The Prow, 1 Wilder Walk, London W1B 5AP
> WGSN Inc., tax ID 04-3851246, registered office c/o National Registered
> Agents, Inc., 160 Greentree Drive, Suite 101, Dover DE 19904, United States
> 4C Serviços de Informação Ltda., CNPJ/MF (Taxpayer's Register):
> 15.536.968/0001-04, Address: Avenida Cidade Jardim, 377, 7˚ andar CEP
> 01453-000, Itaim Bibi, São Paulo 4C Business Information Consulting
> (Shanghai) Co., Ltd, 富新商务信息咨询(上海)有限公司, registered address Unit 4810/4811,
> 48/F Tower 1, Grand Gateway, 1 Hong Qiao Road, Xuhui District, Shanghai
>
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com

Re: DateRangeField and Faceting

Posted by Stephen Weiss <St...@wgsn.com>.
One small detail - I just realized I've been doing JSON faceting and the wiki refers to old-school faceting.  Old-school faceting indeed does work but the problem is the facet is ultimately one of a whole tree of stats I'm collecting, so JSON facet is far more convenient for my use case (I don't think I can even do what I'm doing with old facets).  Why would daterangefield work with the old faceting system and not the new?

--
Steve

On Fri, Apr 21, 2017 at 11:50 AM, Stephen Weiss <St...@wgsn.com>> wrote:
Hi everyone,

Just trying to do a sense check on this.  I'm trying to do a facet based off a DateRangeField and I'm hitting this error:

Error from server at http://172.20.141.150:8983/solr/instock_au_shard1_replica0: Unable to range facet on field:sku_history.date_range{type=daterange,properties=indexed,stored,omitTermFreqAndPositions}


Now I read through FacetRange.java and it seems like only TrieFields are accepted, while DateRangeField is a spatial type, so I suppose that makes sense. However, elsewhere in the codebase under DateCalc (which is essentially the same set of restrictions) it says:

if (! (field.getType() instanceof TrieDateField) ) { throw new IllegalArgumentException("SchemaField must use field type extending TrieDateField or DateRangeField"); }

Is this for some reason assuming that DateRangeField is a subclass of TrieDateField (it isn't)? I also see a mention here of someone doing a facet on a DateRangeField and having it work:

https://wiki.apache.org/solr/DateRangeField

In his case, his daterangefield is multivalued and it seemed to work for him - mine is simpler than that yet it doesn't work. I don't really understand what we're doing differently that matters, and reading the codebase, it really doesn't seem like this was ever possible - but that comment under DateCalc makes me wonder.

If we could facet on the daterangefield, it would be very helpful, so any pointers on how to do that would be welcome.

--
Steve


WGSN (www.wgsn.com) is the world’s leading trend authority for creative thinkers in over 94 countries. Our services cover consumer insights, fashion and lifestyle forecasting, data analytics, crowd-sourced design validation and expert consulting. We help drive our customers to greater success. Together, we Create Tomorrow.

WGSN is part of WGSN Limited, comprising of market-leading products including WGSN Insight, WGSN Fashion, WGSN Instock, WGSN Lifestyle & Interiors, WGSN Styletrial and WGSN Mindset, our bespoke consultancy services. WGSN is owned by Ascential plc, a leading international media company that informs and connects business professionals in 150 countries through market-leading Exhibitions and Festivals, and Information Services.

The information in or attached to this email is confidential and may be legally privileged. If you are not the intended recipient of this message, any use, disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you have received this message in error, please notify the sender immediately by return email and delete this message and any copies from your computer and network.

WGSN does not warrant that this email and any attachments are free from viruses and accepts no liability for any loss resulting from infected email transmissions.

WGSN reserves the right to monitor all email through its networks. Any views expressed may be those of the originator and not necessarily of WGSN. WGSN is powered by Ascential plc, which transforms knowledge businesses to deliver exceptional performance.

Please be advised all phone calls may be recorded for training and quality purposes and by accepting and/or making calls from and/or to us you acknowledge and agree to calls being recorded.

WGSN Limited, Company number 4858491

Registered Address:

Ascential plc, The Prow, 1 Wilder Walk, London W1B 5AP
WGSN Inc., tax ID 04-3851246, registered office c/o National Registered Agents, Inc., 160 Greentree Drive, Suite 101, Dover DE 19904, United States 4C Serviços de Informação Ltda., CNPJ/MF (Taxpayer's Register): 15.536.968/0001-04, Address: Avenida Cidade Jardim, 377, 7˚ andar CEP 01453-000, Itaim Bibi, São Paulo 4C Business Information Consulting (Shanghai) Co., Ltd, 富新商务信息咨询(上海)有限公司, registered address Unit 4810/4811, 48/F Tower 1, Grand Gateway, 1 Hong Qiao Road, Xuhui District, Shanghai