Hi,

I am new to lucene ... I have a question while implementing similarity search 
using MoreLikeThis query. I have written a small program but it is not giving 
any results. In my index file I have both strored and unstored(analyzed) 
fields.  

Sample Code :

IndexReader ir =  IndexReader.open(index directory path);
                        IndexSearcher indexsearcher = new 
ProfileIndexSearcher(ir);
                        IndexSearcher indexsearcher = new IndexSearcher(ir);
                        MoreLikeThis mlt = new MoreLikeThis(ir);
                        Analyzer analyzer = new 
StandardAnalyzer(Version.LUCENE_30);                    
                        mlt.setAnalyzer(analyzer);
                        mlt.setFieldNames(string_of_fields);
                        
                        Query query1 = mlt.like(1); // mlt.like(docnumber)
                        TopDocs matches = null;
                        matches = indexsearcher.search(query1,20); 

As per my understanding I should atleast one document as result. 

Is any one has idea what I can do to implement this serach.
Thanks in Advance.

--Madhu.

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

Reply via email to