Field.Keyword vs new Field(String, String, true, true, true)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Field.Keyword vs new Field(String, String, true, true, true)

Yousef Ourabi
I have a quick question on the Field class. What is the difference between this:

for ()
Field content = new Field("content", contentArray[i], true, true, true, true);
doc.add(content);

and this:

doc.add(Field.Keyword("userAlias", userAlias ));

In the first example where the constructor is uesed will the second
term be entered as a Keyword by default? I am a little confused
because the JavaDoc's list both and I am not clear on the difference.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Field.Keyword vs new Field(String, String, true, true, true)

Erik Hatcher

On Jun 24, 2005, at 2:46 PM, Yousef Ourabi wrote:

> I have a quick question on the Field class. What is the difference  
> between this:
>
> for ()
> Field content = new Field("content", contentArray[i], true, true,  
> true, true);
> doc.add(content);
>
> and this:
>
> doc.add(Field.Keyword("userAlias", userAlias ));

The boolean parameters line up to these flags, in order: boolean  
store, boolean index, boolean token, boolean storeTermVector

Field.Keyword is the same as true, true, false, false

Your first call stores, indexes, tokenizes, and stores term vectors.  
Your second call is a field that is stored and indexed, but neither  
tokenized nor storing term vectors.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]