Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6661137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:14:32+00:00 2026-05-26T02:14:32+00:00

I am trying to boost certain documents. But they dont get boosted. Please tell

  • 0

I am trying to boost certain documents. But they dont get boosted. Please tell me what I am missing. Thanks!

In my index code I have:

if (myCondition)  
{
   myDocument.SetBoost(1.1f);
}
myIndexWriter.AddDocument(document);

then in my search code I retrieve the collection of documents from the ScoreDocs object into myDocuments collection and:

    foreach (Lucene.Net.Documents.Document doc in myDocuments)
    {
        float tempboost = doc.GetBoost();
    }

and I place a breakpoint in the foreach clause to break if the tempboost is not 1. and the breakpoint is never hit.

What did I miss?

Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:14:32+00:00Added an answer on May 26, 2026 at 2:14 am

    From javadoc of Lucene (Java version but same behaviors apply):

    public float getBoost()

    Returns, at indexing time, the boost factor as
    set by setBoost(float).

    Note that once a document is indexed this value is no longer available
    from the index. At search time, for retrieved documents, this method
    always returns 1.
    This however does not mean that the boost value set
    at indexing time was ignored – it was just combined with other
    indexing time factors and stored elsewhere, for better indexing and
    search performance.

    note: for those of you who get NaN when retrieving the score please use the following line

    searcher.SetDefaultFieldSortScoring(true,true);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get
Boost Network I am trying out this code in a small console app on
I'm trying setup a subset of boost and get it properly compiled using bjam,
I'm trying to get boost set up on my machine as I wish to
I am trying to lean boost::bind, boost::lambda libraries and how they can be used
I'm trying to build Boost.MPI 1.47 with Intel MPI 4.0.0.012, but Boost is not
Im trying to change the thread priority in boost but im having no luck.
I am trying to use Boost's lexical_cast for my C++ project but am running
I'm trying to use boost unit testing alongside the Allegro graphics library, but both
i'm trying to use boost regex within my program the problem is i get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.