weird problem with solr.DateField

View: New views
2 Messages — Rating Filter:   Alert me  

weird problem with solr.DateField

by siping liu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

by Otis Gospodnetic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <sipingliu@...>
> To: solr-user@...
> 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