views:

97

answers:

2

What is the best way to add datefield to a document (i just need YYYYMMDD)

Whats the best way to query against datefield

Im creating the datefield as the following

newDoc.Add(new Field("newsdate", "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

but it slow down searches when adding a criteria of this field. what should i do for this field.???

+1  A: 

I think you need a NumericRangeQuery. To use it, you need to index the DateTime as a NumericField.

Yuval F