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 Victor Hadianto <vi...@nuix.com.au> on 2002/05/23 06:49:10 UTC

Problem with Field.Keyword

We are developing application that indexes email using Lucene. To index 
document we use the message id field of the email as the primary key. 

The message id field looks like:

<02...@host86.syd.nuix.com.au>
<81...@excsrv44.mayo.edu>
<3D...@mail.totalise.co.uk>

We store this message id as Field.Keyword.

Unfortunately when we are storing the message id, searching and deleting of 
documents (very important for us) doesn't work.

*If* the message id is stored as Field.Text it will work for searching but 
not _deletion_. 

I'm 100% the code works because as soon as I substitute the message id into 
ordinary number such as 1, 2, 3 everything works as coded :D

Any suggestions?

Regards,

-- 
Victor Hadianto

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem with Field.Keyword

Posted by Victor Hadianto <vi...@nuix.com.au>.
>
> When you index do you store
>
> > <02...@host86.syd.nuix.com.au>
> > <81...@excsrv44.mayo.edu>
> > <3D...@mail.totalise.co.uk>
>
> Or
>
> <3D...@mail.totalise.co.uk>
>

This is what I store, just a single message id. 

> The reason why I ask is that Keyword does not tokenize (that is what ever
> you put into that field is seen as a single term).
>

That is what I thought as well. As soon as I changed the message id into an 
internal id that I generated myself everything works. Must be something 
strange with the format of the message id.

-- 
Victor Hadianto

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem with Field.Keyword

Posted by Peter Carlson <ca...@bookandhammer.com>.
I am a little unclear,

When you index do you store

> <02...@host86.syd.nuix.com.au>
> <81...@excsrv44.mayo.edu>
> <3D...@mail.totalise.co.uk>

Or 

<3D...@mail.totalise.co.uk>

The reason why I ask is that Keyword does not tokenize (that is what ever
you put into that field is seen as a single term).

So if you want to find it you have to search for exactly what you typed in
(including case sensitive).

Does that help?

--Peter


On 5/22/02 10:56 PM, "Victor Hadianto" <vi...@nuix.com.au> wrote:

>> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00194.html
> 
> Hmm not quite my problem here.
> 
>> if not try explaining your problem in a little bit more detail so
>> we can help
> 
> 
> OK ..  let me try again ...
> 
> basically I have a field in the document which I derive from the message id
> of an email, they look like:
> 
> <02...@host86.syd.nuix.com.au>
> <81...@excsrv44.mayo.edu>
> <3D...@mail.totalise.co.uk>
> 
> The problem is that I couldn't search Lucene using this field. If I store
> this field as Text I can search and find the document but I couldn't delete
> it using the following:
> 
> indexReader.delete(new Term("id", "<3D...@mail.totalise.co.uk>");
> 
> This will return 0.
> 
> If I store the id as a keyword, I couldn't even search the field.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem with Field.Keyword

Posted by Victor Hadianto <vi...@nuix.com.au>.
> http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00194.html

Hmm not quite my problem here.

> if not try explaining your problem in a little bit more detail so
> we can help


OK ..  let me try again ...

basically I have a field in the document which I derive from the message id 
of an email, they look like:

<02...@host86.syd.nuix.com.au>
<81...@excsrv44.mayo.edu>
<3D...@mail.totalise.co.uk>

The problem is that I couldn't search Lucene using this field. If I store 
this field as Text I can search and find the document but I couldn't delete 
it using the following:

indexReader.delete(new Term("id", "<3D...@mail.totalise.co.uk>");

This will return 0.

If I store the id as a keyword, I couldn't even search the field.

-- 
Victor Hadianto



> regards,
>
> Nader Henein
>
> -----Original Message-----
> From: Victor Hadianto [mailto:victorh@nuix.com.au]
> Sent: Thursday, May 23, 2002 8:49 AM
> To: Lucene Users List
> Subject: Problem with Field.Keyword
>
>
>
> We are developing application that indexes email using Lucene. To index
> document we use the message id field of the email as the primary key.
>
> The message id field looks like:
>
> <02...@host86.syd.nuix.com.au>
> <81...@excsrv44.mayo.edu>
> <3D...@mail.totalise.co.uk>
>
> We store this message id as Field.Keyword.
>
> Unfortunately when we are storing the message id, searching and deleting of
> documents (very important for us) doesn't work.
>
> *If* the message id is stored as Field.Text it will work for searching but
> not _deletion_.
>
> I'm 100% the code works because as soon as I substitute the message id into
> ordinary number such as 1, 2, 3 everything works as coded :D
>
> Any suggestions?
>
> Regards,
>
> --
> Victor Hadianto
>
> --
> 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>


RE: Problem with Field.Keyword

Posted by "Nader S. Henein" <ns...@bayt.net>.
I'm not sure if this is the case
but this message posted on the mail archive might
help:
http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00194.html

if not try explaining your problem in a little bit more detail so
we can help

regards,

Nader Henein

-----Original Message-----
From: Victor Hadianto [mailto:victorh@nuix.com.au]
Sent: Thursday, May 23, 2002 8:49 AM
To: Lucene Users List
Subject: Problem with Field.Keyword



We are developing application that indexes email using Lucene. To index
document we use the message id field of the email as the primary key.

The message id field looks like:

<02...@host86.syd.nuix.com.au>
<81...@excsrv44.mayo.edu>
<3D...@mail.totalise.co.uk>

We store this message id as Field.Keyword.

Unfortunately when we are storing the message id, searching and deleting of
documents (very important for us) doesn't work.

*If* the message id is stored as Field.Text it will work for searching but
not _deletion_.

I'm 100% the code works because as soon as I substitute the message id into
ordinary number such as 1, 2, 3 everything works as coded :D

Any suggestions?

Regards,

--
Victor Hadianto

--
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>