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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:24:27+00:00 2026-05-27T07:24:27+00:00

I’m with some problems in Django Haystack 1.2.5. I need to boost one field

  • 0

I’m with some problems in Django Haystack 1.2.5. I need to boost one field but aparently it is not working. I’m using Solr 1.4.1.

My Index:

class JobsTextIndex(indexes.SearchIndex):
    text            = indexes.CharField(document=True, use_template=True)
    job_title       = indexes.CharField(model_attr='job_title', boost=1.50)
    job_description = indexes.CharField(model_attr='job_description')
    country_ad      = indexes.CharField(model_attr='country_ad')
    zone_ad         = indexes.CharField(model_attr='zone_ad', faceted=True)
    location_ad     = indexes.CharField(model_attr='location_ad', faceted=True)
    date_inserted   = indexes.DateTimeField(model_attr='date_inserted')

    def index_queryset(self):
    """Used when the entire index for model is updated."""
    return JobsadsText.objects.filter(date_inserted__lte=datetime.datetime.now())

I have in the job_title “boost=1.50” but this apparently it is not working, this is what is generated by Solr:

INFO: [core0] webapp=/solr path=/select/ params={facet=on&sort=date_inserted+desc&fl=*+score&start=0&q=arquiteto&facet.field=location_ad_exact&facet.field=zone_ad_exact&wt=json&fq=django_ct:(myapp.jobstext)&rows=20} hits=65 status=0 QTime=5 

The query that I’m doing is this one:

sqs = SearchQuerySet().facet('zone_ad').facet('location_ad').order_by('-date_inserted')

Can someone give me a clue on what I need to get Haystack Boost working?

Best Regards,


Update 1: I need to give more importance to the “job_title” field. If for example I’m searching for the word “programmer” I need to show in the first place the results that have “programmer” in the “job_title” field ordered by date and then the results that have the word “programmer” in the “job_description” field. The Haystack boost is the right tool to achieve 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-05-27T07:24:28+00:00Added an answer on May 27, 2026 at 7:24 am

    Specifying boost=1.5 in your field definition is how you tell Haystack to use ‘Field boost’ on that specific field. From the Haystack documentation:

    There are three types of boost:

    • Term Boost

    • Document Boost

    • Field Boost

    Term boost happens at query time (when the search query is run) and is
    based around increasing the score is a certain word/phrase is seen.

    On the other hand, document & field boosts take place at indexing time
    (when the document is being added to the index). Document boost causes
    the relevance of the entire result to go up, where field boost causes
    only searches within that field to do better.

    You’ve specified field boost in your code, which will boost the field when the model is indexed, not when you make your query. The good news is that the boost you specified will still be used when a search is made on that field, but will be applied implicitly, rather than being specified explicitly in the query to Solr.

    I don’t think the query you’ve specified will have the boost applied to it though as you haven’t searched on any fields.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
For some reason, after submitting a string like this Jack’s Spindle from a text
I have just tried to save a simple *.rtf file with some websites and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.