IBSurgeon / lucene_udr

Lucene FTS UDR
51 stars 6 forks source link

Timestamp field indexing #9

Open livius2 opened 6 months ago

livius2 commented 6 months ago

Hi

what are the rules of indexing Timestamp fields? How can i find records by timestamp?

I see e.g. this for date:

BYDATE:[20020101 TO 20030101]

But date is stored without separators 20020101, is it done by FTS$MANAGEMENT.FTS$ADD_INDEX_FIELD? How timestamp fields are stored and how to find by its values?

sim1984 commented 6 months ago

Currently timestamp is saved in the index in the format YYYY-MM-DD HH:MI:SS.zzzz

We need to see if lucene++ can search by dates. If so, then I will think about how to change the storage of dates in the index.

sim1984 commented 6 months ago

The date is stored in the index as it will be a string, i.e. CAST(DateField AS VARCHAR(36)), and for date searching to work it must be saved without delimiters. When I have time I'll try this.