[EMAIL PROTECTED] writes:
> Hi!
>
> I want to store numbers (id) in my index:
>
> long id = 1069421083284;
> doc.add(Field.UnStored("in", String.valueOf(id)));
>
> But searching for "id:1069421083284" doesn't return any hits.
If your field is named 'in' you shouldn't search in 'id'. Right?
>
> Well, did I misunderstand something? UnStored is the number is stored but not
> index (analyzed), isn't it? Anyway, Field.Text doesn't work either.
>
Well, indexing and analyzing are different things.
UnStored means, the number is not stored (as the name says) but indexed.
And IIRC it's analyzed before indexing. Shouldn't make a difference for
a single number.
What I'd use in this case is an unstored keyword (given that you really don't
want to have the id returned from lucene, which is the consequence of
not storing).
I'm not sure if there's a method to create such a field, but you can do it
by setting the flags directly.
HTH
Morus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]