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

  • Home
  • SEARCH
  • 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 8001539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:07:08+00:00 2026-06-04T16:07:08+00:00

The haystack documentation (link below) makes this statement: Additionally, we’re providing use_template=True on the

  • 0

The haystack documentation (link below) makes this statement:

Additionally, we’re providing use_template=True on the text field.
This allows us to use a data template (rather than error prone
concatenation) to build the document the search engine will use in
searching.

How would one go about using concatenation to build the document? I couldn’t find an example.

It may have something to do with overriding the prepare method (second link). But in the example given in the documentation the prepare method is used together with a template, so the two might also be orthogonal.

https://github.com/toastdriven/django-haystack/blob/master/docs/tutorial.rst

http://django-haystack.readthedocs.org/en/latest/searchindex_api.html#advanced-data-preparation

  • 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-04T16:07:10+00:00Added an answer on June 4, 2026 at 4:07 pm

    You can see how it works in the Haystack source. Basically, the default implementation of the prepare method on SearchField (the base class for Haystack’s fields) calls prepare_template if use_template is True.

    If you don’t want to use a template, you can indeed use concatenation – it’s as simple as just joining the data you want together, separated by something (here I’ve used a newline):

    def prepare_myfield(self, obj):
        return self.cleaned_data['field1'] + '\n' + self.cleaned_data['field2']
    

    etc.

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

Sidebar

Related Questions

Im using haystack to search my django website, it does this perfectly. However on
This questions is about Django Haystack, with Whoosh backend. I would like to use
I have this string: $string = 'foo bar php haystack needle' And i want
I have a problem with django-haystack. According to this tutorial I got this apps:
I'm with some problems in Django Haystack 1.2.5. I need to boost one field
I want to be able to use django-haystack to do full text searches on
I'm trying to set up Haystack with Whoosh but am getting this value error
string Haystack[] = { Alabama, Alaska, American Samoa, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,
I want to use Django Haystack with Xapian on my django site for search
I've set up django with haystack but im having a few problems. I have

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.