Here's a work around:
1. Define a schema with the date as a string and use the different whitespace
analyzer:
{field, [
{name, "birthday"},
{type, string},
{analyzer_factory,
"com.basho.search.analysis.WhitespaceAnalyzerFactory"}
]}
2. Store dates as YYYYMMDDHHMMSS. Don't even think about adding '-' or ':' or
' ' anywhere in there, as it will split the tokens.
3. Then, query ranges in the same format as above will do what you think that
should.
-- GWF
On Jan 17, 2011, at 3:42 PM, Gary William Flake wrote:
> I can find no documentation anywhere for the desired format for date fields
> in riak search.
>
> I've looked at Lucene documentation thinking that it should be the same.
> From there I can see that Lucene made a significant transition at some point
> with respect to dates, but the documentation
>
> http://lucene.apache.org/java/3_0_3/api/all/org/apache/lucene/document/DateTools.html#dateToString(java.util.Date,%20org.apache.lucene.document.DateTools.Resolution)
>
>
> seems to suggest that the format is yyyyMMddHHmmssSSS. I tried this, but no
> joy.
>
> I've tried using seconds since 1970, but at best this is only a stop gap
> because I have dates before 1970 that I need to consider.
>
> I also tried using a standard field, hoping that lexographical ranges would
> work for me. Alas, I think the tokenizer is not indexing my dates because
> they don't look like useful things to index.
>
> I am grateful for any hints.
>
> Thanks,
> -- GWF
>
> PS -- Thanks to: Joseph Lambert and Rusty Klophaus for help with the numeric
> field issue; Jeremiah Peschka, and Runar Jordahl for helping with my question
> for sorted records, and Eric Moritz for pointing me towards Riak Search as
> the solution to that last issue.
>
>
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com