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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:26:38+00:00 2026-06-15T20:26:38+00:00

My purpose is to find animals(doc) given a city (term) I’ve indexed documents this

  • 0

My purpose is to find animals(doc) given a city (term)

I’ve indexed documents this way:

doc1(bear)  = [city1, city2, city2, city3..]
doc2(dog)   = [city1, city1, city1, city2, city2, city2, city3, city3, city3..]
..

I’d like to penalize (animals)documents that appear in a lot of cities, therefore documents with an high percentage of different cities/all cities like “dog”.

Any suggestions? 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-06-15T20:26:40+00:00Added an answer on June 15, 2026 at 8:26 pm

    It already does!

    See Similarity.computeNorm.

    The norm function, by default, considers matches on shorter fields to be a more precise match, and so scores them higher than longer fields.

    If you need this to have a heavier impact, you can override the DefaultSimilarity with a custom version, and modify the value returned from the computeNorm method to weigh the lengthNorm portion of the calculation more heavily. I’d recommend just adding a multiplier somewhere in the existing algorithm, if you need to do that, but tweak it however you need to.

    Note! As stated in the API, this value is stored in the index, not computed at query time. You must reindex to see changes take effect.


    The calculation in computeNorm (3.6.0) is:

    state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms)))
    

    Where numterms is the total number of terms in the field, and state is a FieldInvertState.

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

Sidebar

Related Questions

The purpose of this question is to find the best way to print data
The purpose of this program is to find the kth smallest element in an
I'm trying to find a good general purpose way to canonicalize urls in an
I cannot find anything informative about the purpose of this flag. Does anyone know?
I couldn't find a question that would fit this purpose, so I'm asking it.
The code in question is here: var $item = $(this).parent().parent().find('input'); What is the purpose
I read an e-book and find this command, but I don't know it's purpose
I have searched a lot trying to find something for my purpose, however most
For testing purposes I have this shell script #!/bin/bash echo $$ find / >/dev/null
[purpose] This simple command sequence runs expected in the Windows' CMD shell: dir &

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.