Not all documents and fields are created equal—or at least you can make sure that’s the case by using boosting. Boosting may be done during indexing or during searching. #1 Boosting Documents Document boosting is a feature that makes such a requirement simple to implement. By default, all documents have no boost—or, rather, they all have the same boost factor of 1.0. By changing a document’s boost factor, you can instruct Lucene to consider it more or less important with respect to other documents in the index when computing relevance. For example: if (isImportant(lowerDomain)) { doc.setBoost(1.5F); } else if (isUnimportant(lowerDomain)) { doc.setBoost(0.1F); } #2 Boosting fields Just as you can boost documents, you can also boost individual fields. When you boosta document, Lucene internally uses the same boost factor to boost each of its fields. Imagine that another requirement for the email-indexing application is to consider the subject field more important than t...
The reason for doing the work is to create something useful that helps people. Please click the ads if my articles are useful for you. Definitely, that's not enough. My target is working at some great organizations, such that one day, all the people with internet access can benefit from the service I contributed.