You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jan Stövesand <j....@finix.de> on 2001/12/14 12:37:30 UTC
Can't get a DateFilter to work
Hi,
I really tried everything to get a DateFilter to work but I failed. :-(
What I did was:
Indexing:
doc.add( Field.Keyword("last-modifed",
DateField.timeToString( timeInMillies ) );
e.g.
millies: 1008269714990
field value: 0cv6xr772
If i submit a "normal" query, looking for 0cv6xr772 I find the entry, i.e.
the entry should be indexed correctly.
If I search for a text in the body of the element I find about 30 entries
including the one mentioned above with last-midified=0cv6xr772.
If I repeat the same query with
DateFilter filter=new DateFilter("last-modified", 0, 2008269714990);
Hits hits = searcher.search(query, filter);
I do not get any results. What am I doing wrong?
Any help appreciated.
JAn
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: AW: Can't get a DateFilter to work
Posted by Manfred Schäfer <ms...@bouncy.com>.
Hi,
i've got the same problem. i has forgotten to store the field value for the date
field (only indexing is not enough!)
manfred
Jan Stövesand wrote:
> Hi,
>
> it is no typo. I thought that a DateFilter will return everything between
> "from" (0) and "to" (2008269714990), specified in the parameter list.
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: tril@pluto.blackwell.co.uk [mailto:tril@pluto.blackwell.co.uk]Im
> > Auftrag von Ian Lea
> > Gesendet: Freitag, 14. Dezember 2001 12:40
> > An: Lucene Users List
> > Betreff: Re: Can't get a DateFilter to work
> >
> >
> > Could be just a typo in the email message, but 1008269714990 !=
> > 2008269714990.
> >
> >
> > --
> > Ian.
> > ian.lea@blackwell.co.uk
> >
> > Jan Stövesand wrote:
> > >
> > > Hi,
> > >
> > > I really tried everything to get a DateFilter to work but I failed. :-(
> > >
> > > What I did was:
> > >
> > > Indexing:
> > >
> > > doc.add( Field.Keyword("last-modifed",
> > > DateField.timeToString( timeInMillies ) );
> > >
> > > e.g.
> > > millies: 1008269714990
> > > field value: 0cv6xr772
> > >
> > > If i submit a "normal" query, looking for 0cv6xr772 I find the
> > entry, i.e.
> > > the entry should be indexed correctly.
> > > If I search for a text in the body of the element I find about
> > 30 entries
> > > including the one mentioned above with last-midified=0cv6xr772.
> > >
> > > If I repeat the same query with
> > >
> > > DateFilter filter=new DateFilter("last-modified", 0, 2008269714990);
> > > Hits hits = searcher.search(query, filter);
> > >
> > > I do not get any results. What am I doing wrong?
> > > Any help appreciated.
> > >
> > > JAn
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
AW: AW: Can't get a DateFilter to work: SOLVED
Posted by Jan Stövesand <j....@finix.de>.
The problem is solved.
There was a small difference in the code used for searching with/without a
Datefilter. The error was in the code building the actual result set and NOT
in the code doing the search itself. That's why I didn't see it.
Now everything works find.
Thanks to all who helped.
Jan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: AW: Can't get a DateFilter to work
Posted by Ian Lea <ia...@blackwell.co.uk>.
Sorry, my mistake. I glanced at your message and leapt to
the wrong conclusion. Don't know what is wrong in your code
but since I had been meaning to get to grips with Date
searching in Lucene but had never made time to do so, have
knocked up a test program, attached to this message, which
creates a small index and searches on a few ranges, including
0 to 2008269714990, and it seems to work fine. Perhaps it
may help you track down your problem.
If not, and you still want help, I suggest you post the
simplest possible program that demonstrates the problem.
--
Ian.
ian.lea@blackwell.co.uk
Jan St�vesand wrote:
>
> Hi,
>
> it is no typo. I thought that a DateFilter will return everything between
> "from" (0) and "to" (2008269714990), specified in the parameter list.
>
> Jan
>
> > -----Urspr�ngliche Nachricht-----
> > Von: tril@pluto.blackwell.co.uk [mailto:tril@pluto.blackwell.co.uk]Im
> > Auftrag von Ian Lea
> > Gesendet: Freitag, 14. Dezember 2001 12:40
> > An: Lucene Users List
> > Betreff: Re: Can't get a DateFilter to work
> >
> >
> > Could be just a typo in the email message, but 1008269714990 !=
> > 2008269714990.
> >
> >
> > --
> > Ian.
> > ian.lea@blackwell.co.uk
> >
> > Jan St�vesand wrote:
> > >
> > > Hi,
> > >
> > > I really tried everything to get a DateFilter to work but I failed. :-(
> > >
> > > What I did was:
> > >
> > > Indexing:
> > >
> > > doc.add( Field.Keyword("last-modifed",
> > > DateField.timeToString( timeInMillies ) );
> > >
> > > e.g.
> > > millies: 1008269714990
> > > field value: 0cv6xr772
> > >
> > > If i submit a "normal" query, looking for 0cv6xr772 I find the
> > entry, i.e.
> > > the entry should be indexed correctly.
> > > If I search for a text in the body of the element I find about
> > 30 entries
> > > including the one mentioned above with last-midified=0cv6xr772.
> > >
> > > If I repeat the same query with
> > >
> > > DateFilter filter=new DateFilter("last-modified", 0, 2008269714990);
> > > Hits hits = searcher.search(query, filter);
> > >
> > > I do not get any results. What am I doing wrong?
> > > Any help appreciated.
> > >
> > > JAn
> >
> > --
AW: Can't get a DateFilter to work
Posted by Jan Stövesand <j....@finix.de>.
Hi,
it is no typo. I thought that a DateFilter will return everything between
"from" (0) and "to" (2008269714990), specified in the parameter list.
Jan
> -----Ursprüngliche Nachricht-----
> Von: tril@pluto.blackwell.co.uk [mailto:tril@pluto.blackwell.co.uk]Im
> Auftrag von Ian Lea
> Gesendet: Freitag, 14. Dezember 2001 12:40
> An: Lucene Users List
> Betreff: Re: Can't get a DateFilter to work
>
>
> Could be just a typo in the email message, but 1008269714990 !=
> 2008269714990.
>
>
> --
> Ian.
> ian.lea@blackwell.co.uk
>
> Jan Stövesand wrote:
> >
> > Hi,
> >
> > I really tried everything to get a DateFilter to work but I failed. :-(
> >
> > What I did was:
> >
> > Indexing:
> >
> > doc.add( Field.Keyword("last-modifed",
> > DateField.timeToString( timeInMillies ) );
> >
> > e.g.
> > millies: 1008269714990
> > field value: 0cv6xr772
> >
> > If i submit a "normal" query, looking for 0cv6xr772 I find the
> entry, i.e.
> > the entry should be indexed correctly.
> > If I search for a text in the body of the element I find about
> 30 entries
> > including the one mentioned above with last-midified=0cv6xr772.
> >
> > If I repeat the same query with
> >
> > DateFilter filter=new DateFilter("last-modified", 0, 2008269714990);
> > Hits hits = searcher.search(query, filter);
> >
> > I do not get any results. What am I doing wrong?
> > Any help appreciated.
> >
> > JAn
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Can't get a DateFilter to work
Posted by Ian Lea <ia...@blackwell.co.uk>.
Could be just a typo in the email message, but 1008269714990 != 2008269714990.
--
Ian.
ian.lea@blackwell.co.uk
Jan Stövesand wrote:
>
> Hi,
>
> I really tried everything to get a DateFilter to work but I failed. :-(
>
> What I did was:
>
> Indexing:
>
> doc.add( Field.Keyword("last-modifed",
> DateField.timeToString( timeInMillies ) );
>
> e.g.
> millies: 1008269714990
> field value: 0cv6xr772
>
> If i submit a "normal" query, looking for 0cv6xr772 I find the entry, i.e.
> the entry should be indexed correctly.
> If I search for a text in the body of the element I find about 30 entries
> including the one mentioned above with last-midified=0cv6xr772.
>
> If I repeat the same query with
>
> DateFilter filter=new DateFilter("last-modified", 0, 2008269714990);
> Hits hits = searcher.search(query, filter);
>
> I do not get any results. What am I doing wrong?
> Any help appreciated.
>
> JAn
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>