1
votes

When I look at the Zend framework documentation, Zend Search Lucene has the ability to boost search terms.

Is there a way to boost fields? That is, make hits in a field more relevant than others?

Example:

Document1
Name: Jane Doe
Description: Wife of John Doe

Document2
Name: John Doe
Description: Husband of Jane Doe

Search query = "John Doe"

In this example, I want to boost "Name" field because it is more relevant. The search results should list Document2 first rather than Document1

1
I read both Jane and John as John. Was thinking whats the difference between the 2 documents!!Lenin Raj Rajasekaran

1 Answers

2
votes

Yes, use the setBoost method of the field. (I'm not familiar with Zend's implementation, but I assume they have an equivalent method.)