Ok, I have a custom indexer built and it works but the data (from Archetype) is stored as text. How can I specify that the field should be type of date? I don't see anywhere to specify the type when adding a field:
not sure if i understand what you're asking, but if i'm storing dates in the index, i found you have to store them in lucene friendly fashion eg 20150315, then you can run lucene queries like so
(lucenceFriendlyCreatedDate:[20150315 TO 20150316])
and in my node gathering event, i just add them like:
So I think best option is to keep same formating when injecting and searching dates. When format is the same, with same number of characters, it is just about string comparing during search so there is no need to set specific type of indexed field,
e.g. I'm using formating string like this:
yyyy-MM-ddTHH:mm:ss
and I think it is the default format returned by Date Picker with Time property editor
Custom Examine Indexer: Add Field As Date?
Ok, I have a custom indexer built and it works but the data (from Archetype) is stored as text. How can I specify that the field should be type of date? I don't see anywhere to specify the type when adding a field:
nodeData.Fields.Add(string.Format("archetype-{0}-{1}", fieldset.Alias, index), value);
hi
not sure if i understand what you're asking, but if i'm storing dates in the index, i found you have to store them in lucene friendly fashion eg 20150315, then you can run lucene queries like so
and in my node gathering event, i just add them like:
Hope that helps!
cheers
ian
Hi Robert, you could also try to set the type of the field in ExamineIndex.config:
Cheers!
Thanks, Pawel. That's good to know but it wouldn't work in this case as the field names are dynamic/variable.
So I think best option is to keep same formating when injecting and searching dates. When format is the same, with same number of characters, it is just about string comparing during search so there is no need to set specific type of indexed field,
e.g. I'm using formating string like this:
and I think it is the default format returned by Date Picker with Time property editor
is working on a reply...