Apache solr not working on running start.jar

330 views
Skip to first unread message

SammyJ

unread,
Aug 28, 2018, 9:32:38 AM8/28/18
to django-oscar
Hi,
I am following the steps provided to install solr give here:https://django-oscar.readthedocs.io/en/latest/howto/how_to_setup_solr.html , so I have extracted the solr tar file and I have run the command: ./manage.py build_solr_schema > solr-4.7.2/example/solr/collection1/conf/schema.xml.

Then the output shown is:



Save the following output to 'schema.xml' and place it in your Solr configuration directory.
--------------------------------------------------------------------------------------------

And after the dotted line it's blank.So I just copied this line above the existing xml code in schema.xml, and ran the command 
java -jar start.jar

then I got an error, so I just removed it from the schema.xml file 
and then I ran the same java -jar start.jar,
the error that I get now is:
3552 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – Unable to create core: collection1
org.apache.solr.common.SolrException: Schema Parsing Failed: unknown field 'id'. Schema file is /home/netzary/SamuelProjects/cecilia_new2/cecilia/solr-4.7.2/example/solr/collection1/schema.xml
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:618)
        at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166)
        at org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55)
        at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:559)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: unknown field 'id'
        at org.apache.solr.schema.IndexSchema.getIndexedField(IndexSchema.java:340)
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:536)
        ... 13 more
3561 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – null:org.apache.solr.common.SolrException: Unable to create core: collection1
        at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:989)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:606)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.solr.common.SolrException: Schema Parsing Failed: unknown field 'id'. Schema file is /home/netzary/SamuelProjects/cecilia_new2/cecilia/solr-4.7.2/example/solr/collection1/schema.xml
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:618)
        at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166)
        at org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55)
        at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:559)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        ... 8 more
Caused by: java.lang.RuntimeException: unknown field 'id'
        at org.apache.solr.schema.IndexSchema.getIndexedField(IndexSchema.java:340)
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:536)
        ... 13 more

3564 [main] INFO  org.apache.solr.servlet.SolrDispatchFilter  – user.dir=/home/netzary/SamuelProjects/cecilia_new2/cecilia/solr-4.7.2/example
3565 [main] INFO  org.apache.solr.servlet.SolrDispatchFilter  – SolrDispatchFilter.init() done
3619 [main] INFO  org.eclipse.jetty.server.AbstractConnector  – Started SocketC...@0.0.0.0:8983
    


How do I solve this? Is there something wrong with the XML file or the command that I ran?I am not able to figure.

wil...@byteful.ch

unread,
Sep 25, 2018, 5:08:12 AM9/25/18
to django-oscar
Hi Sammy,

I just set it up yesterday.

I you followed the instructions in the docs, you probably ran the command to make the schema. According to this thread there is a problem with the generated schema. Theres a schema  provided in the thread (this link) download it and replace the one which was generated.

That got it running for me.

If and when you need to extend your search fields, you can do so by adding them to the schema file and re building the index.

Stewart

SammyJ

unread,
Sep 26, 2018, 2:36:44 AM9/26/18
to django-oscar
Hi,
Thanks for your help.
By extending the search fields you mean I should add an extra parameter like this?
<field name="category" type="text_en" indexed="true" stored="true" multiValued="true" />

I would like to add an extra search by product type as well to my search, so I just have to create an extra <field name="product_type">?
Reply all
Reply to author
Forward
0 new messages