lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph P├Ąchter <Paech...@htwg-konstanz.de>
Subject Re: Please Help me on Lucene
Date Thu, 01 Feb 2007 15:39:24 GMT
I am also only novice, but that should work for you.

One row in your table ==> one doc in lucene:

I would indice it like that for one row/document:

Document doc = new Document();

doc.add(new Field("prod_Id....
doc.add(new Field("prod_name...
...
writer.addDocument(doc);



Now check your index using Luke: http://www.getopt.org/luke/
Just start the web version quickly and look at your index. (Luke is simple and
nice to use, mostly self-explanatory)
You can search for your value and look at the docs. So use it to check your 
query...


If you search for a value, in your class you get the hits-object.

Hits hits = searcher.search(query);

Document doc = hits.doc(i);//gives you the document (rank i), which is one row.

doc.get("prod_Id"); to retrieve the fieldvalues

Cheers,
Christoph

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


Mime
View raw message