2

I have been trying for quite some time to get search working in my Django site using haystack and solr as the backend engine. I have generated the schema.xml file however i am not sure where to put it. I am on windows. I have tried a lot of options by searching on google and on stackoverflow as well but to no avail. I have looked into other questions such as : Django haystack doesn't add to Solr index. [Works with whoosh, fails with Solr] solr + haystack + django where do I place schema.xml? I found many other questions also but am not listing them here. I followed everything from them and tried but to no avail. I always get the same below error:

Failed to clear Solr index: [Reason: Error 404 Not Found]
Indexing 24 my_models
Failed to add documents to Solr: [Reason: Error 404 Not Found]

Here is my settings.py for your reference:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://127.0.0.1:8983/solr'
        # ...or for multicore...
        # 'URL': 'http://127.0.0.1:8983/solr/mysite',
    },
}

Could you please help me understand what to do? I have generated the schema.xml but where exactly to place it in windows? Also what is this error? if i am not clear in asking please do tell, i will try to be more precise and clear. Thanks for your help

Edit1: The directory structure for the example folder:

  +---example-DIH
    |   +---hsqldb
    |   \---solr
    |       +---db
    |       |   +---conf
    |       |   |   +---clustering
    |       |   |   |   \---carrot2
    |       |   |   +---lang
    |       |   |   \---xslt
    |       |   \---lib
    |       +---mail
    |       |   +---conf
    |       |   |   +---clustering
    |       |   |   |   \---carrot2
    |       |   |   +---lang
    |       |   |   \---xslt
    |       |   \---lib
    |       +---rss
    |       |   \---conf
    |       |       +---clustering
    |       |       |   \---carrot2
    |       |       +---lang
    |       |       \---xslt
    |       +---solr
    |       |   \---conf
    |       |       +---clustering
    |       |       |   \---carrot2
    |       |       +---lang
    |       |       \---xslt
    |       \---tika
    |           \---conf
    +---exampledocs
    +---films
    \---resources

Any help is appreciated. have been stuck on this for 1 day now

Community
  • 1
  • 1
user145078
  • 241
  • 2
  • 3
  • 8

1 Answers1

0

I have never used it on Windows but I guess the path for schema.xml should be same for both Windows and Linux. You need to build schema, copy the generated contents and paste them inside schema.xml which can be found at:

<path-to-extracted-solr>/example/solr/collection1/conf

Once you have updated the schema, restart the solr server using the command:

java -jar start.jar

start.jar can be found at <path-to-extracted-solr>/example/

Animesh Sharma
  • 3,258
  • 1
  • 17
  • 33
  • There is no such folder. I have tried placing the schema.xml in different places such as inside example, inside conf which is inside server and so on but to no avail. ...Ihave edited my question to display the directory structure – user145078 May 14 '15 at 12:22
  • I downloaded solr 5.1.0. schema.xml can be found here: `/server/solr/configsets/basic_configs/conf/` And start.jar can be found here: `/server/` – Animesh Sharma May 14 '15 at 12:38
  • Can solr be accessed via browser at http://127.0.0.1:8983/solr ? If yes, choose a core and click on files. There check up your schema.xml if it's same as the one you inserted. – Animesh Sharma May 15 '15 at 05:23
  • it is accessible...there is some problem with solr version 5+. I tried with 4.10 and everything works just fine – user145078 May 15 '15 at 08:57