SolrError: Failed to connect to server

80 views
Skip to first unread message

Fendy Pierre

unread,
Apr 7, 2019, 7:45:45 PM4/7/19
to django-oscar
Whenever I try to view the products, they're not being displayed. Getting the error: 

Failed to query Solr using '*:*': Failed to connect to server at 'http://127.0.0.1:8983/solr/select/?q=%2A%3A%2A&fl=%2A+score&df=text&start=0&rows=1&spe
llcheck=true&spellcheck.collate=true&spellcheck.count=1&facet=on&facet.field=product_class_exact&facet.field=rating_exact&facet.query=price_exact%3A%5B0
+TO+20%5D&facet.query=price_exact%3A%5B20+TO+40%5D&facet.query=price_exact%3A%5B40+TO+60%5D&facet.query=price_exact%3A%5B60+TO+%2A%5D&fq=django_ct%3A%28
catalogue.product%29&wt=json', are you sure that URL is correct? Checking it in a browser might help: HTTPConnectionPool(host='127.0.0.1', port=8983): M
ax retries exceeded with url: /solr/select/?q=%2A%3A%2A&fl=%2A+score&df=text&start=0&rows=1&spellcheck=true&spellcheck.collate=true&spellcheck.count=1&f
acet=on&facet.field=product_class_exact&facet.field=rating_exact&facet.query=price_exact%3A%5B0+TO+20%5D&facet.query=price_exact%3A%5B20+TO+40%5D&facet.
query=price_exact%3A%5B40+TO+60%5D&facet.query=price_exact%3A%5B60+TO+%2A%5D&fq=django_ct%3A%28catalogue.product%29&wt=json (Caused by NewConnectionErro
r('<urllib3.connection.HTTPConnection object at 0x000001FF5C6048D0>: Failed to establish a new connection: [WinError 10061] No connection could be made
because the target machine actively refused it'))

Any idea? 

SammyJ

unread,
Apr 8, 2019, 12:55:21 AM4/8/19
to django-oscar
That is because you are trying yo use solr without running the solr's server you must run the command java -jar start.jar in the background.Follow the docs Here.

Fendy Pierre

unread,
Apr 8, 2019, 7:33:49 PM4/8/19
to django-oscar
I followed the instructions but got the following error: 

at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Schema Parsing Failed: unknown field 'id'.

SammyJ

unread,
Apr 9, 2019, 4:05:15 AM4/9/19
to django-oscar
OK just download this schema.zip from here: github and then extract and copy the schema.xml to solr-4.7.2/example/solr/collection1/conf/  over here there is a schema.xml which you must replace, then go to solr-4.7.2/example and run java -jar start.jar

pythan

unread,
Apr 9, 2019, 7:42:01 AM4/9/19
to django-oscar
Thank you SammyJ, this schema.xml file seems to work.. I can start the solr server.

But when I run oscar, I get this warning:

C:\Users\CHUWIL~1\Envs\oscar\lib\site-packages\haystack\query.py:373: UserWarning: The model <class 'catalogue.models.Product'> is not registered for search.
  warnings.warn('The model %r is not registered for search.' % (model,))

Do I need to add catalogue.models.Product to the schema.xml?? 

Fendy Pierre

unread,
Apr 9, 2019, 10:27:00 AM4/9/19
to django-oscar
I'm not getting any error anymore but items are still not displaying. Also when trying to register a new user , I get an error message that the targeted machine is actively refusing.

pythan

unread,
Apr 9, 2019, 10:35:24 AM4/9/19
to django-oscar
I get also no items displayed, and sometimes I get a timeout from solr (e.g. when I use the search).
I am also not sure about my search_indexes.py. I modified it, and now I cannot use excluded_indexes anymore...

Fendy Pierre

unread,
Apr 9, 2019, 10:48:06 AM4/9/19
to django-oscar
Ah I see, I'm still getting adjusted to Oscar so I haven't made any modifications outside of the doc. Not until it behaves as expected. 

pythan

unread,
Apr 9, 2019, 12:01:53 PM4/9/19
to django-oscar
I guess I found my fault.
I had to rebuild the index WHILE the solr server is running!
Hope that can help someone. :)

Fendy Pierre

unread,
Apr 9, 2019, 2:23:43 PM4/9/19
to django-oscar
Are your results populating now? 

pythan

unread,
Apr 9, 2019, 3:16:08 PM4/9/19
to django-oscar
Yes they do. And now I got the "refine your search" option on the searchpage.
At this point, I'm trying to apply filtering by attributes..

Fendy Pierre

unread,
Apr 9, 2019, 6:02:21 PM4/9/19
to django-oscar
Same here, worked! Except Images aren't loading
Message has been deleted

pythan

unread,
Apr 9, 2019, 6:58:13 PM4/9/19
to django-oscar
Great! Do you want to refine your search by custom values?

Fendy Pierre

unread,
Apr 9, 2019, 10:57:12 PM4/9/19
to django-oscar
Yes! Can you email me? fendy...@gmail.com I had a few other questions since it seems like we're both in the initial development stage.

Thanks alot SammyJ! 
Reply all
Reply to author
Forward
0 new messages