Solr server up and running. created server in search api and it creates successfully. create index select a couple of fields and get Couldn't index items. Check the logs for details. when I go to index. watchdog says An error occurred while indexing: '400' Status: Bad Request. solr says
127.0.0.1 - - [23/02/2012:20:47:19 +0000] "POST /solr/update?wt=json HTTP/1.0" 400 1438
solr admin showing Solr Admin (drupal-3.0-beta14)....cwd=/home/apache-solr-1.4.0/example SolrHome=solr/
all configs were copied over to solr as per insructions. The index I create is node type but I've tried other types still get message.
solr indexes successfully in Apache Solr search module.
I've been chasing this a couple of days unplugging replugging recreating server and indexes. Any direction would be appreciated.

Comments

thedosmann’s picture

Priority: Critical » Major
thedosmann’s picture

found this in solr log
Feb 23, 2012 9:15:09 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: Document [test-3] missing required field: entity_type
at org.apache.solr.update.DocumentBuilder.toDocument
I have verified that the schema files are the same as come with module

Could not get past this. I initially installed the Apache Solr search module and got good results. I then wanted to see if this api would give me more options/flex. I unistalled Apache Solr search module and I installed this module following install instructions and replaced the 2 xml files in the solr config that came with this this module. Started getting the error when creating an index. I checked the solr schema browser and saw that the entity_type field was there. I stopped the solr instance deleted the sample solr index directory, verified the 2 xml files were correct and then restarted solr. The field was still there. I may visit this later but for now will work with the Apache Solr search module as it connects and indexes with no issues.

thedosmann’s picture

Status: Active » Needs review
jthomasbailey’s picture

Status: Needs review » Active

I'm getting it too, I thought maybe it was because I was because I was using 3.5 with this solrconfig.txt. Here's the Solr output when I try indexing with Search API Solr:

Feb 26, 2012 7:58:41 PM org.apache.solr.update.processor.LogUpdateProcessor finish
INFO: {add=[index_2-2]} 0 1
Feb 26, 2012 7:58:41 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: [doc=index_2-2] missing required field: entity_type
	at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:346)
	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
	at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:158)
	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:79)
	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:58)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Feb 26, 2012 7:58:41 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/update params={wt=json} status=400 QTime=1 
mitch albert’s picture

I had the same error. It seems that my schema.xml and solrconfig.xml where not the correct ones.
The ones from the search_api_solr and the solr integration module are not the same schema.xml.

kevinquillen’s picture

I got this same error. Here is how I fixed it:

1. Copy schema.xml and solrconfig.xml from Search API Solr into /path/to/solr/conf
2. Restart the Solr service
3. Try to Reindex

After I did that (I simply forgot to restart Solr) I was able to index without 400 error.

drunken monkey’s picture

As #5 and #6 state, you seem to use the wrong schema.xml (and probably solrconfig.xml, too). Please use the ones provided with the module and, if this solves the problem, mark this issue as "fixed".

thedosmann’s picture

Status: Active » Fixed

I couldn't get past this. I replaced and verified the xml files. It is possiable that my issue was connected to my solr install as I had some issues with getting it to run as a service on my flavour of linux. Can't verify because I switched to working with Ajax solr and was able to get it working on drupal 7 as I needed (date, auto-complete, content, etc widgets in a drilldown facets search on several forums, groups, tags etc.). I'll change to fixed but I can't verify my issue because I gave up the ghost after several weeks into this. I can verify I unistalled solr twice and reinstalled and did the same with Search API and verified the xmls were correct but I must add that my solr was not running as a service and it's likely some cacheing was going on serverside or perhaps something else???

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ymakux’s picture

1. Copy schema.xml and solrconfig.xml from Search API Solr into /path/to/solr/conf
2. Restart the Solr service
3. Try to Reindex

Oh, man, you made my day. I had another issue - documents never sent to Apache Solr. Using Xampp with Tomcat on Win XP. The above fixed my problem. Thanks!

soul88’s picture

Have the same error, but for different reason.

Solr search works fine. But when I enable indexing of hierarchical structures (taxonomies) and then try to re-index my content - I get the error described above.

Having spent some time with debugger I found out that Solr actually replies the following info to Drupal:

HTTP/1.1 400 ERROR: [doc=test_content_index-18] multiple values encountered for non multiValued field ss_field_hierarch_taxon:name: [term6, term5]

This happens only if I check to index parent elements on the "Workflow" tab. How can this be fixed?

soul88’s picture

Status: Closed (fixed) » Active
kenorb’s picture

Version: 7.x-1.0-rc1 » 7.x-1.0-rc2

The same problem with rc2.
Content generated by devel_generate, the field is just Text field. Tried to clear the index, restarting solr, didn't help much.
This happens only when field has 'String' type, it does work when it has 'Fulltext'.
Field settings: /admin/config/search/search_api/index/job_search/fields

Error:

SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=job_search-155] multiple values encountered for non multiValued field ss_field_job_location_txt: [amet, quadrum, quidne, tation]
kenorb’s picture

Status: Active » Fixed

This issue is mix of different separate issues, so I'm closing it.

Problem with:

multiple values encountered for non multiValued field

SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=job_search-155] multiple values encountered for non multiValued field ss_field_job_location_txt: [amet, quadrum, quidne, tation]

is reported here:
#1909496: Tokenizer: multiple values encountered for non multiValued when field type is String



Problem with:

'400' Status: Bad Request

If you have error:
An error occurred while indexing: '400' Status: Bad Request
Please make sure that you have all schema files in place and you read the installation instructions.
Most of the problems are caused by mis-configuration of solr server (copied wrong schema files).
If you think this is the bug, please report it separately with some more details.

If you've 400 using Acquia Network (search_api_acquia module), please check this issue:
#1751662: Couldn't index items. Check the logs for details.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

aryashreep’s picture

Issue summary: View changes

#10 Worked for me.