But is there a way to combine the scores of the individual fields to create one total score? The problem is that the highest ranking document for the 'title' query will not necessarily match the highest ranking document for the 'heading' query. I suppose I could simply add them up, but that would mean iterating through all the results of both queries and adding the scores to find the highest combined total. I don't suppose Lucene has a method of ANDing in this manner to create a combined total field score?
- Mike ----- Original Message ----- From: "Peter Carlson" <[EMAIL PROTECTED]> To: "Lucene Users List" <[EMAIL PROTECTED]> Sent: Friday, June 21, 2002 2:35 PM Subject: Re: Weighted index > Or you could convert the query to > > title:"use search string"^5 > Or > heading:"user search string"^3 > > The ^ symbol will add the boosting factor to the score. > > You could also do this once you create the Query from the QueryParser, but > this is up to you. Before or after the QueryParser, but I would probably > have Lucene do the scoring. > > --Peter > > On 6/21/02 12:15 PM, "Mike Tinnes" <[EMAIL PROTECTED]> wrote: > > > > > I suppose I could take the users search string and use it to query on > > multiple fields using the query syntax. Then weight the resulting scores for > > the individual fields as I wish. Something like this..? > > > > score_1 = results of searching with 'title:"user search string"' > > score_2 = results of searching with 'heading: "user search string"' > > ... > > score = ((score_1 * 5) + (score_2 * 10)) / 15 > > > > - Mike > > > > > > ----- Original Message ----- > > From: "Peter Carlson" <[EMAIL PROTECTED]> > > To: "Lucene Users List" <[EMAIL PROTECTED]> > > Sent: Friday, June 21, 2002 1:48 PM > > Subject: Re: Weighted index > > > > > >> Lucene supporting boosting of terms in a query which will increase it > >> relative weighting in the search results, but this is not supported on a > >> index level. > >> > >> So you could get the users query and add a boost factor to those fields > > you > >> want to have higher relevancy. There has been some discussion on how to do > >> this at the indexing level, but nothing has started yet. > >> > >> --Peter > >> > >> > >> On 6/21/02 11:39 AM, "Mike Tinnes" <[EMAIL PROTECTED]> wrote: > >> > >>> > >>> Hey all, is there any method that allows for the weighting of indexed > > fields? > >>> I'd like to implement a web search in which keywords occuring in certain > >>> elements (title, heading, metatags) score higher than others (body, > > links, > >>> etc). > >>> > >>> Thanks, Mike > >>> > >>> > >> > >> > >> -- > >> To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > >> For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > >> > > > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
