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 siping liu <si...@hotmail.com> on 2009/11/12 01:29:18 UTC

weird problem with solr.DateField

Hi,

I'm using Solr 1.4 (from nightly build about 2 months ago) and have this defined in solrconfig:

<fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true" />

<field name="lastUpdate" type="date" indexed="true" stored="true" default="NOW" multiValued="false" />

 

and following code that get executed once every night:

CommonsHttpSolrServer solrServer = new CommonsHttpSolrServer("http://...");
solrServer.setRequestWriter(new BinaryRequestWriter());

solrServer.add(documents);
solrServer.commit();

UpdateResponse deleteResult = solrServer.deleteByQuery("lastUpdate:[* TO NOW-2HOUR]");
solrServer.commit();

 

The purpose is to refresh index with latest data (in "documents").

This works fine, except that after a few days I start to see a few documents with no "lastUpdate" field (query "-lastUpdate:[* TO *]") -- how can that be possible?

 

thanks in advance.

 
 		 	   		  
_________________________________________________________________
Windows 7: Unclutter your desktop.
http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009

Re: weird problem with solr.DateField

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Try changing:
<field name="lastUpdate" type="date" indexed="true" stored="true" default="NOW" multiValued="false" />

to:
<field name="lastUpdate" type="date" indexed="true" stored="true" default="NOW" multiValued="false" required="true"/>
 
Then watch the logs for errors during indexing.

Otis--
Sematext is hiring -- http://sematext.com/about/jobs.html?mls
Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR



----- Original Message ----
> From: siping liu <si...@hotmail.com>
> To: solr-user@lucene.apache.org
> Sent: Wed, November 11, 2009 7:29:18 PM
> Subject: weird problem with solr.DateField
> 
> 
> Hi,
> 
> I'm using Solr 1.4 (from nightly build about 2 months ago) and have this defined 
> in solrconfig:
> 
> 
> omitNorms="true" />
> 
> 
> multiValued="false" />
> 
> 
> 
> and following code that get executed once every night:
> 
> CommonsHttpSolrServer solrServer = new CommonsHttpSolrServer("http://...");
> solrServer.setRequestWriter(new BinaryRequestWriter());
> 
> solrServer.add(documents);
> solrServer.commit();
> 
> UpdateResponse deleteResult = solrServer.deleteByQuery("lastUpdate:[* TO 
> NOW-2HOUR]");
> solrServer.commit();
> 
> 
> 
> The purpose is to refresh index with latest data (in "documents").
> 
> This works fine, except that after a few days I start to see a few documents 
> with no "lastUpdate" field (query "-lastUpdate:[* TO *]") -- how can that be 
> possible?
> 
> 
> 
> thanks in advance.
> 
> 
>                           
> _________________________________________________________________
> Windows 7: Unclutter your desktop.
> http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009