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 9014085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:25:33+00:00 2026-06-16T03:25:33+00:00

I am trying to boost particular documents based on a field value. It is

  • 0

I am trying to boost particular documents based on a field value. It is generally working ok but some documents return a higher score even though they have a smaller boost value.

After debugging the query with the debugQuery=on request parameter I have noticed that the idf function is returning a higher score for a particular document, which is affecting the overall score.

Is there a way to ignore tf/idf scoring at query time?

  • 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-06-16T03:25:34+00:00Added an answer on June 16, 2026 at 3:25 am

    You’ll want to create a custom Similarity which overrides the tf and idf methods, and use it in place of the DefaultSimilarity.

    Something like:

    class CustomSimilarity extends DefaultSimilarity {
    
        @Override
        public float tf(float freq) {
            return 1.0;
        }
    
        @Override
        public float tf(int freq) {
            return 1.0;
        }
    
        @Override
        // Note the signature of this method may now take longs:
        //   public float idf(long docFreq, long numDocs)
        public float idf(int docFreq, int numDocs) {
            return 1.0;
        }
    }
    

    The set it to use that similarity in your schema.xml:

    <similarity class="myorg.mypackage.CustomSimilarity"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to boost certain documents. But they dont get boosted. Please tell
I am trying to use boost::atomic to do multithreading synchronization on linux. But, the
I'm trying to utilize Boost.Test in Visual Studio 2010, and I'm having some trouble
I am having problem with lucene boosting, Iam trying to boost a particular document
I'm trying to build Boost.MPI 1.47 with Intel MPI 4.0.0.012, but Boost is not
I'm trying to use Boost's multi-index container for fast look up, but I'm having
I'm trying to use boost::iterator_facade with an incomplete Value template argument. This fails, because
I've been trying to read the boost::gil documentation, but it's somewhere between lacking, and
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

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.