lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Weiss <Steve.We...@wgsn.com>
Subject DateRangeField Query throws NPE
Date Mon, 03 Aug 2015 23:28:35 GMT
Hi everyone,

I'm running into a trouble building a query with DateRangeField.  Web-based queries work fine,
but this code throws an NPE:


dateRangeQuery = dateRangeField.getRangeQuery(null, SidxS.getSchema().getField("sku_history.date_range"),
start_date_str, end_date_str, true, true);

ERROR - 2015-08-03 23:07:10.122; [   instock_dev] org.apache.solr.common.SolrException; null:com.google.common.util.concurrent.UncheckedExecutionException:
java.lang.NullPointerException
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2263)
at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4789)
at org.apache.solr.schema.AbstractSpatialFieldType.getStrategy(AbstractSpatialFieldType.java:403)
at org.apache.solr.schema.AbstractSpatialFieldType.getQueryFromSpatialArgs(AbstractSpatialFieldType.java:331)
at org.apache.solr.schema.DateRangeField.getRangeQuery(DateRangeField.java:184)
at com.wgsn.ginger.stockStatusQuery.getFilterCollector(stockStatusQuery.java:128)
at org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(SolrIndexSearcher.java:1148)
at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1609)
at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1485)
at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:561)
at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:518)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:255)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2064)
...
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType.newSpatialStrategy(AbstractSpatialPrefixTreeFieldType.java:117)
at org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType.newSpatialStrategy(AbstractSpatialPrefixTreeFieldType.java:40)
at org.apache.solr.schema.AbstractSpatialFieldType$2.call(AbstractSpatialFieldType.java:406)
at org.apache.solr.schema.AbstractSpatialFieldType$2.call(AbstractSpatialFieldType.java:403)
at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4792)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
... 38 more


That line 117 seems to be some logging happening in that class, which is probably unnecessary
to begin with:

log<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/5.1.0/org/apache/solr/schema/AbstractSpatialFieldType.java#AbstractSpatialFieldType.0log>.info<http://grepcode.com/file/repo1.maven.org/maven2/org.slf4j/slf4j-api/1.7.7/org/slf4j/Logger.java#Logger.info%28java.lang.String%29>(this.toString<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/5.1.0/org/apache/solr/schema/FieldType.java#FieldType.toString%28%29>()+"
strat: "+strat+" maxLevels: "+ grid<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/5.1.0/org/apache/solr/schema/AbstractSpatialPrefixTreeFieldType.java#AbstractSpatialPrefixTreeFieldType.0grid>.getMaxLevels<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.lucene/lucene-spatial/5.1.0/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTree.java#SpatialPrefixTree.getMaxLevels%28%29>());//TODO
output maxDetailKm

No idea which variable is returning null, kinda guessing it's the grid.getMaxLevels() since
I don't see this being initialized by any prior methods in this chain.  Is this just a bug
or am I using it wrong?  I'm trying to wrap this query together with two other queries but
I can't even get the Query object back.

--
Steve

________________________________

WGSN is a global foresight business. Our experts provide deep insight and analysis of consumer,
fashion and design trends. We inspire our clients to plan and trade their range with unparalleled
confidence and accuracy. Together, we Create Tomorrow.

WGSN<http://www.wgsn.com/> is part of WGSN Limited, comprising of market-leading products
including WGSN.com<http://www.wgsn.com>, WGSN Lifestyle & Interiors<http://www.wgsn.com/en/lifestyle-interiors>,
WGSN INstock<http://www.wgsninstock.com/>, WGSN StyleTrial<http://www.wgsn.com/en/styletrial/>
and WGSN Mindset<http://www.wgsn.com/en/services/consultancy/>, our bespoke consultancy
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 Top Right Group<http://www.topright-group.com>,
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:

Top Right Group Limited, 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 Nove de Julho, 5966, Loja, CEP 01406-200, Jardim Europa, 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message