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 Christoph Pächter <Pa...@htwg-konstanz.de> on 2007/02/01 16:39:24 UTC
Re: Please Help me on Lucene
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