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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:38:28+00:00 2026-06-11T02:38:28+00:00

In ElasticSearch, I’ve created two documents with one field, CategoryMajor In doc1, I set

  • 0

In ElasticSearch, I’ve created two documents with one field, “CategoryMajor”

In doc1, I set CategoryMajor to “Restaurants”

In doc2, I set CategoryMajor to “Restaurants Restaurants Restaurants Restaurants Restaurants”

If I perform a search for CategoryMajor:Restaurants, doc1 shows up as MORE RELEVANT than doc2. Which is not typical Lucene behavior, which gives more relevance the more times a term shows up. doc2 should be MORE RELEVANT than doc1.

How in do I fix this?

  • 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-11T02:38:29+00:00Added an answer on June 11, 2026 at 2:38 am

    You can add &explain=true to your GET query to see that score of doc2 is lowered by “fieldNorm” factor. This is caused by default lucene similarity calculation formula, which lowers score for longer documents. Please read this document about default lucene similarity formula:

    http://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/search/Similarity.html

    To disable this behaviour add “omit_norms=true” for CategoryMajor field to your index mapping by sending PUT request to:

    http://localhost:9200/index/type/_mapping
    

    with request body:

    {
        "type": {
             properties": {
                "CategoryMajor": {
                    "type": "string",
                    "omit_norms": "true"
               }
            }
        }
    }
    

    I’m not certain, but it may be necessary to delete your index, create it again, put above mapping and then reindex your documents. Reindexing after changing mapping is necessary for sure :).

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

Sidebar

Related Questions

I am indexing Elasticsearch documents with a nested field containing another nested field(so 2
i have elasticsearch database of geo objects. I want to search the nearest objects
I am using SearchBuilder.searchSource.query(query_string).buildAsBytes() to perform the query string on elasticsearch servers. The problem
I have a simple sounding problem according highlighting of a field with elasticsearch version
Using elasticsearch, I'd like to get a histogram facet for a price field in
I am new to elasticsearch and I would like to do a filtered search:
I want to use ElasticSearch to search filenames (not the file's content). Therefore I
I'm using elasticsearch to index my documents. Is it possible to instruct it to
I have several models indexed with elasticsearch and one of them has an association
I'm eyeballing the use of ElasticSearch or solr for 'jailed' search results. By jailed

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.