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 "Thierry Ferrero (Itldev.info)" <fe...@itldev.info> on 2004/11/09 17:18:19 UTC

Searching in keyword field ?

Hi All,

Can i search only one word in a keyword field which contains few words.
I know keyword field isn't tokenized. After many tests, i think is
impossible.
Someone can confirm me ?

Why don't i use a text field? because the users know the category from a
list (ex: category ABC, category DEF GHI, category  JKL ...) and the keyword
field 'category' can contains severals terms (ABC, DEF GHI, OPQ RST).
I use a SnowBallAnalyzer for text field in indexing.
Perhaps the better way for me, is to use a text field with the value "ABC
DEF_GHI  JKL_NOPQ" where categorys are concatinated with a "_".
Thanks for your reply !

Thierry.



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Searching in keyword field ?

Posted by Thierry Ferrero <fe...@itldev.info>.
Thanks Justin, it works fine !!!!

----- Original Message ----- 
From: "Justin Swanhart" <gr...@gmail.com>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Tuesday, November 09, 2004 7:41 PM
Subject: Re: Searching in keyword field ?


> You can add the category keyword multiple times to a document.
>
> Instead of seperating your categories with a delimiter, just add the
> keyword multiple times.
>
> doc.add(Field.Keyword("category", "ABC");
> doc.add(Field.Keyword("category", "DEF GHI");
>
> On Tue, 9 Nov 2004 17:18:19 +0100, Thierry Ferrero (Itldev.info)
> <fe...@itldev.info> wrote:
> > Hi All,
> >
> > Can i search only one word in a keyword field which contains few words.
> > I know keyword field isn't tokenized. After many tests, i think is
> > impossible.
> > Someone can confirm me ?
> >
> > Why don't i use a text field? because the users know the category from a
> > list (ex: category ABC, category DEF GHI, category  JKL ...) and the
keyword
> > field 'category' can contains severals terms (ABC, DEF GHI, OPQ RST).
> > I use a SnowBallAnalyzer for text field in indexing.
> > Perhaps the better way for me, is to use a text field with the value
"ABC
> > DEF_GHI  JKL_NOPQ" where categorys are concatinated with a "_".
> > Thanks for your reply !
> >
> > Thierry.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Searching in keyword field ?

Posted by Justin Swanhart <gr...@gmail.com>.
You can add the category keyword multiple times to a document.

Instead of seperating your categories with a delimiter, just add the
keyword multiple times.

doc.add(Field.Keyword("category", "ABC");
doc.add(Field.Keyword("category", "DEF GHI");

On Tue, 9 Nov 2004 17:18:19 +0100, Thierry Ferrero (Itldev.info)
<fe...@itldev.info> wrote:
> Hi All,
> 
> Can i search only one word in a keyword field which contains few words.
> I know keyword field isn't tokenized. After many tests, i think is
> impossible.
> Someone can confirm me ?
> 
> Why don't i use a text field? because the users know the category from a
> list (ex: category ABC, category DEF GHI, category  JKL ...) and the keyword
> field 'category' can contains severals terms (ABC, DEF GHI, OPQ RST).
> I use a SnowBallAnalyzer for text field in indexing.
> Perhaps the better way for me, is to use a text field with the value "ABC
> DEF_GHI  JKL_NOPQ" where categorys are concatinated with a "_".
> Thanks for your reply !
> 
> Thierry.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org