lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morofiler <morofi...@gmail.com>
Subject Search and relevance by document name and content
Date Sun, 27 Feb 2011 15:27:15 GMT
I want to make a search using lucene and having sorting by relevance amongs
the document name and its content .
When I gather hits in TopDocs like :

Code:
<code>
 QueryParser parserC = new QueryParser(Version.LUCENE_30, "contents", new
StandardAnalyzer(Version.LUCENE_30));
        QueryParser parserN = new QueryParser(Version.LUCENE_30, "filename",
new StandardAnalyzer(Version.LUCENE_30));
        QueryParser parserP = new QueryParser(Version.LUCENE_30, "fullpath",
new StandardAnalyzer(Version.LUCENE_30))

 Query queryC = parserC.parse(q);
        Query queryN = parserN.parse(q);
        Query queryP = parserP.parse(q);

 TopDocs hits = is.search(queryC, 10);
             hits = is.search(queryN, 10);
             hits = is.search(queryP, 10);

</code>

The content of hits is replaced everytime and its value is is.search(queryP,
10)
Is there any method (like add or something or even a collector) to store all
the results in one TopDocs hit and make a sort by relevance .


Thank you .

ps : excuse me for my very bad english .


-- 
View this message in context: http://lucene.472066.n3.nabble.com/Search-and-relevance-by-document-name-and-content-tp2588786p2588786.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message