When I query (ex. +label:barbara) I get results in the form:
{:label=>“NEW TOOL FOR BARBERS.”, :page_id=>“36”, :label_sort=>“NEW TOOL
FOR BARBERS.”, :page=>“4”, :date=>“1900-03-02”, :content_type=>“19”,
:title=>“1”, :article_id=>“7855”, :content=>" NEW TOOL FOR BARBERS."}
…
Which looks correct to me but if I modify the query to include a date
range like “+label:barbara +data:{19000101 19010101}” or even
“+label:barbara +data:(>=19000101 AND <= 19010101}” I get 0 results.
Does anybody know what I am doing incorrectly?
I am using Windows Vista, Ferret version 0.11.5 mswin32.
On Fri, 2008-01-11 at 11:14 -0800, Benjamin A. wrote:
Hello,
I am having trouble getting data ranges to work correctly. I am using
the following command to load the db:
Hi Benjamin,
the .to_s method for the Date object returns a date formatted like
"2007-12-25, so for one you’re searching for a string that doesn’t exist
in the index.
Secondly, I’m pretty sure the hypens in that string will be tokenized by
the Ferret tokenizer, so will end up in the database as separate parts,
so a range query would be slow (or not work, not certain).
Try explicitly returning the date in a useful format when putting it in
the index:
It worked changing the format too %Y%m%d. So, Ruby does not really
handle dates directly? I would have thought Ferret would have parsed
the Date object internally. Anyways, thanks for the help!
Benjamin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.