You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Amit Bhavsar <an...@mailbox.syr.edu> on 2003/09/18 15:55:58 UTC

Adding String in a Field

Hi,

I am trying to add fields to a document as show below:

doc.add(Field.Text(fieldName, newString));


Here fieldName and newString are both strings. I wanted to have the words in 
newString searchable, ie indexed.

Currently, I am using a StringTokenizer to get tokens from the string and 
adding '\n' between tokens.

Is there a quicer and cleaner way of doing this reliably?

Here is a sample strings I am trying to add:
"Interactive teaching, Computer simulations, Universe, Computational science, 
GalaxSee software, Solar system, Earth, Sun, Gravity, Gravitational pull, 
Orbits, Velocity"

"http://www.shodor.org/master/galaxsee/ = GalaxSee; http://www.shodor.org/ = 
Shodor Education Foundation, Inc.; http://www.shodor.org/master/ = Master 
Tools; http://www.nap.edu/readingroom/books/nses/html/6e.html#csa912 = Click 
here for further information on NSES standards.; 
http://www.shodor.org/master/dodea/index.html = Click here for additional 
information on DoDDs standards"


Any help/input will be appreciated.

thank you.

amit



Re: Adding String in a Field

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Amit, this is a question for the -user list, not -dev list.

I suggest that you look at one of Lucene articles that deal with
indexing.  You will find links to them on the Resources page, which is
listed on Lucene's home page.

Otis

--- Amit Bhavsar <an...@mailbox.syr.edu> wrote:
> Hi,
> 
> I am trying to add fields to a document as show below:
> 
> doc.add(Field.Text(fieldName, newString));
> 
> 
> Here fieldName and newString are both strings. I wanted to have the
> words in 
> newString searchable, ie indexed.
> 
> Currently, I am using a StringTokenizer to get tokens from the string
> and 
> adding '\n' between tokens.
> 
> Is there a quicer and cleaner way of doing this reliably?
> 
> Here is a sample strings I am trying to add:
> "Interactive teaching, Computer simulations, Universe, Computational
> science, 
> GalaxSee software, Solar system, Earth, Sun, Gravity, Gravitational
> pull, 
> Orbits, Velocity"
> 
> "http://www.shodor.org/master/galaxsee/ = GalaxSee;
> http://www.shodor.org/ = 
> Shodor Education Foundation, Inc.; http://www.shodor.org/master/ =
> Master 
> Tools; http://www.nap.edu/readingroom/books/nses/html/6e.html#csa912
> = Click 
> here for further information on NSES standards.; 
> http://www.shodor.org/master/dodea/index.html = Click here for
> additional 
> information on DoDDs standards"
> 
> 
> Any help/input will be appreciated.
> 
> thank you.
> 
> amit
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: Adding String in a Field

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Amit, this is a question for the -user list, not -dev list.

I suggest that you look at one of Lucene articles that deal with
indexing.  You will find links to them on the Resources page, which is
listed on Lucene's home page.

Otis

--- Amit Bhavsar <an...@mailbox.syr.edu> wrote:
> Hi,
> 
> I am trying to add fields to a document as show below:
> 
> doc.add(Field.Text(fieldName, newString));
> 
> 
> Here fieldName and newString are both strings. I wanted to have the
> words in 
> newString searchable, ie indexed.
> 
> Currently, I am using a StringTokenizer to get tokens from the string
> and 
> adding '\n' between tokens.
> 
> Is there a quicer and cleaner way of doing this reliably?
> 
> Here is a sample strings I am trying to add:
> "Interactive teaching, Computer simulations, Universe, Computational
> science, 
> GalaxSee software, Solar system, Earth, Sun, Gravity, Gravitational
> pull, 
> Orbits, Velocity"
> 
> "http://www.shodor.org/master/galaxsee/ = GalaxSee;
> http://www.shodor.org/ = 
> Shodor Education Foundation, Inc.; http://www.shodor.org/master/ =
> Master 
> Tools; http://www.nap.edu/readingroom/books/nses/html/6e.html#csa912
> = Click 
> here for further information on NSES standards.; 
> http://www.shodor.org/master/dodea/index.html = Click here for
> additional 
> information on DoDDs standards"
> 
> 
> Any help/input will be appreciated.
> 
> thank you.
> 
> amit
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com