Solr has downloaded an example from the Internet, but the following error is reported during running: {code ...} I have found answers online, most of which are schema. no field is defined in xml, But I confirm that all the fields I use are defined. I really don't know why. I hope someone will know why !! A beginner Solr downloads an example from the Internet, but the following error is reported during running:
Fatal error: Uncaught exception 'Apache_Solr_HttpTransportException' with message ''400' Status: Bad Request' in /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php:338 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php(1170): Apache_Solr_Service->_sendRawGet('http://localhos...') #1 /Applications/XAMPP/xamppfiles/htdocs/phpSolr/index.php(78): Apache_Solr_Service->search('name: ????', 0, 10) #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php on line 338
I have found answers from the Internet. Most of them say that no field is defined in schema. xml, But I confirm that all the fields I use are defined. I really don't know why. I hope someone will know why !!
Reply content:
A beginner Solr downloads an example from the Internet, but the following error is reported during running:
Fatal error: Uncaught exception 'Apache_Solr_HttpTransportException' with message ''400' Status: Bad Request' in /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php:338 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php(1170): Apache_Solr_Service->_sendRawGet('http://localhos...') #1 /Applications/XAMPP/xamppfiles/htdocs/phpSolr/index.php(78): Apache_Solr_Service->search('name: ????', 0, 10) #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/phpSolr/SolrPhpClient/Apache/Solr/Service.php on line 338
I have found answers from the Internet. Most of them say that no field is defined in schema. xml, But I confirm that all the fields I use are defined. I really don't know why. I hope someone will know why !!
First of all, I want to say that not all milk is named XX Su... and not all errors are called 404...
Your error is'400' Status: Bad Request
... Not 404...
In general, the cause of this error is as you said... yesSchema. xmlField...
But how to analyze it...
Apache_Solr_Service
This class will not return solr internal errors... so we need to solve it in other ways...
The first method is relatively simple... view solr log... there will be content similar to the following line...
SEVERE: org. apache. solr. common. SolrException :****
* *** Is the cause of the error...
The second method... use a tool that comes with solr calledsolr admin
...
In this tool, you can manually enter the query... if the query is invalid, the detailed error message will be displayed...
In your description, you only need to entername:????
Click OK...
With the error message, you can know how to solve this problem. Otherwise, you can only rely on the guesses of the East and the West...
Only saying that solr reports an error... you don't know why you just want others to know... sorry... I don't think anyone will know...
I'm sorry, but the truth is...
First, you must learn to describe your problems well so that others can solve the problems accurately and efficiently ..?
Note that you are callingApache_Solr_Service()
Parameter passing during the constructor. One trap is that the fifth parameter is$compatibilityLayer
The parameters to be passed should be changed according to your Solr server version. For example, if you are Solr 4.0 +, the parameters should be passed.new Apache_Solr_Compatibility_Solr4CompatibilityLayer
.
The reason is that the XML format generated by Solr3 and Solr4 is different. Some parameters are compatible when used, which triggersHTTP 400 Bad Request
Problem. Currently, solr-php-client uses the Solr3 standard by default.
Hope to help you.