lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Search and relevance by document name and content
Date Wed, 02 Mar 2011 21:14:10 GMT

1) since you seem to be using the Lucene Java API, i suggest you send your 
questions to the java-user@lucene list.

2) ...

:  Query queryC = parserC.parse(q);
:         Query queryN = parserN.parse(q);
:         Query queryP = parserP.parse(q);
:  TopDocs hits =, 10);
:              hits =, 10);
:              hits =, 10);


: The content of hits is replaced everytime and its value is,
: 10)

that's a pretty fundemental behavior of Java -- you are assigning a 
value to a variable and it is replacing the previously stored value

: 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 .

it i'm understanding you correctly, what you really want is to combing 
queryC, queryN, and queryP into a single BooleanQuery (probably using 
Occur.SHOULD for all of them) and execute that single resulting query.

But if i understnad correctly (or you have followup questions) please post 
them to the java-user mailing list, where like minding individuals discuss 
 such things.


View raw message