What version of Lucene are you using? 2.0 doesn't have a doc.add like that. You'd do something like doc.add(new Field("title", title, Field.Store.YES, Field.Index.TOKENIZED);
So I really don't understand what you're trying to do. Nor do I understand what "2%" means in this context.... But there are two things you should be aware of. 1> the analyzer you use when you create your index AND when you query your index should be the same, at least when you start. There are reasons why you might want to use different ones, but certainly not when you are starting. Otherwise you, say, index something and it's automatically folded into lowercase (StandardAnalyzer certainly does this) but your query could be uppercase if you use, say SimpleAnalyzer for the query phase. 2> get Luke (google lucene luke). It allows you to examine your index and see what's actually in it. Otherwise you're flying blind. It also allows you to enter queries manually (see Lucene In Action for lucene's query syntax). Really, really get Luke. It'll make your life much easier. You probably want to post bigger snippets of actual code for folks to look at, since one line of code and "it doesn't work" don't give us much to go on <G>. Best Erick On 1/23/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
Hi, I'm pretty new to Lucene and I try to find some help here. I added the title of the document : doc.add(Field.Text("title", title)); e.g. the title is "Constructions" When I do a search on this title I have as result 2% Can someone help me udnerstanding what I am doing wrong ? Thank u. *__________________________________* * Mathieu Decaffmeyer* ============================================ Internet communications are not secure and therefore Fortis Banque Luxembourg S.A. does not accept legal responsibility for the contents of this message. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Nothing in the message is capable or intended to create any legally binding obligations on either party and it is not intended to provide legal advice. ============================================ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]