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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:31:20+00:00 2026-06-11T14:31:20+00:00

I develop site on Windows, but when I tried to add search, I encountered

  • 0

I develop site on Windows, but when I tried to add search, I encountered too many problems with Sphinx and Haystack+Xapian. Possible solution is to go to Linux, but I don’t want to change my working environment. What search library/server/etc do you recommend for Windows? Which version, repository, tutorials have you used? Maybe you can wrote your own mini-tutorial? I really frustrated with this problem and cannot step forward for several days.

  • 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-11T14:31:21+00:00Added an answer on June 11, 2026 at 2:31 pm

    Finally I got Sphinx to work. Still problems with searching in multiple tables but this is solvable I believe.

    Useful links:
    How to install and implement Sphinx Search on XAMPP for Windows 7 with MySQL and PHP

    Tutorial: Installing on Windows

    Installing Sphinx on Windows

    In the following snippets paths on my system are used.

    Search function in views.py:

    def search(request):
        from sphinxapi import SphinxClient, SPH_MATCH_ANY, SPH_SORT_RELEVANCE
        S = request.GET['search']
        client = SphinxClient()
        client.SetServer('127.0.0.1', 9312)
        #client.SetSelect("*, AVG(price) AS avgprice")
        client.SetMatchMode(SPH_MATCH_ANY)
        client.SetSortMode(SPH_SORT_RELEVANCE)
        client.SetFieldWeights({'header': 20, 'text': 10})
        result = client.Query(S, '*')
        matches = result["matches"]
        ids = [match["id"] for match in matches]
        article = {"header": "Search results", "text": ""}
        if ids != []:
            objects = Main.objects.filter(pk__in = ids)
            for object in objects:
                url = request.build_absolute_uri(object.get_absolute_url())
                article["text"] += "<a href=" + url + ">" + object.header + "</a>" + "\n"
            ResponseDict = {"articles": [article]}
        else:
            ResponseDict = {"articles": []}
        return render_to_response("index.html", ResponseDict, 
            context_instance = RequestContext(request))
    

    sphinx.conf (which is in …\Sphinx\bin folder):

    source src1
    {
        type = pgsql
        sql_host = localhost
        sql_user = <db user>
        sql_pass = <pwd>
        sql_db = <db name>
        sql_port = 5432
        sql_query = \
            SELECT id, header, text \
            FROM app_main
        sql_query_info = SELECT * FROM app_main WHERE id=$id
        sql_attr_uint = source_id
    }
    
    
    source src2
    {
        type = pgsql
        sql_host = localhost
        sql_user = <db user>
        sql_pass = <pwd>
        sql_db = <db name>
        sql_port = 5432
        sql_query = \
            SELECT id, header, text \
            FROM app_comment
        sql_query_info = SELECT * FROM app_comment WHERE id=$id
        sql_attr_uint = source_id
    }
    
    
    index test1
    {
        source = src1
        source = src2
        path = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/data/test1
        docinfo = extern
        charset_type = utf-8
    }
    
    
    index testrt
    {
        type = rt
        rt_mem_limit = 32M
        path = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/data/testrt
        charset_type = utf-8
        rt_field = title
        rt_field = content
        rt_attr_uint = gid
    }
    
    
    indexer
    {
        mem_limit = 32M
    }
    
    
    searchd
    {
        listen = 127.0.0.1:9312
        log = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/log/searchd.log
        query_log = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/log/query.log
        read_timeout = 5
        max_children = 30
        pid_file = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/log/searchd.pid
        max_matches = 1000
        seamless_rotate = 1
        preopen_indexes = 1
        unlink_old = 1
        workers = threads # for RT to work
        binlog_path = D:/blizzard/Projects/Python/Web/moz455/app/sphinx/data
    }
    

    Search is available after creating \sphinx, \sphinx\data and \sphinx\log folders in app folder, indexing with command

    D:/Old/Sphinx/bin/indexer --config D:/Old/Sphinx/bin/sphinx.conf --all
    

    and starting searchd with command

    D:/Old/Sphinx/bin/searchd --config D:/Old/Sphinx/bin/sphinx.conf
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop a site using Zend Framework, but i have a problem:
CodeIgniter is brilliant but I'm using it to develop a site where users need
I develop my site on Windows 2003 using IIS6 and Development Server that ships
I have develop a site using wordpress. Its running fine on local machine (windows
I develop the site with Day CQ5 and was faced witha problem. I'm creating
I have to develop a site which has to accomodate around 2000 users a
I want to develop a site that will allow be to publish information to
I need to develop a site on Drupal 7. I have some content types
I am trying to develop a site using pinax. To index the models using
I'm trying to develop a site that recommends items(fx. books) to users based on

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.