我的solr账户有什么问题?(What is wrong with my solr account?)
我正在尝试熟悉solr,最终完成涉及索引.csv文件的学校项目。 我遵循以下网站上的说明: https : //lucene.apache.org/solr/5_4_1/quickstart.html ,特别是索引CSV(逗号/列分隔值)一节。 我按照指定输入了命令(除了使用solr版本6.3.0的im)并且获得了不断的错误。
以下是我输入的终端:
Tylers-MacBook-Pro:6.3.0 tyler$ solr start Archiving 1 old GC log files to /usr/local/Cellar/solr/6.3.0/server/logs/archived Archiving 1 console log files to /usr/local/Cellar/solr/6.3.0/server/logs/archived Rotating solr logs, keeping a max of 9 generations Waiting up to 180 seconds to see Solr running on port 8983 [-] Started Solr server on port 8983 (pid=20594). Happy searching! Tylers-MacBook-Pro:6.3.0 tyler$ bin/post -c gettingstarted example/exampledocs/books.csv java -classpath /usr/local/Cellar/solr/6.3.0/libexec/dist/solr-core-6.3.0.jar -Dauto=yes -Dc=gettingstarted -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/books.csv SimplePostTool version 5.0.0 Posting files to [base] url http://localhost:8983/solr/gettingstarted/update... Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log POSTing file books.csv (text/csv) to [base] SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/gettingstarted/update SimplePostTool: WARNING: Response: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /solr/gettingstarted/update. Reason: <pre> Not Found</pre></p> </body> </html> SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/gettingstarted/update 1 files indexed. COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update... SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/gettingstarted/update?commit=true SimplePostTool: WARNING: Response: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /solr/gettingstarted/update. Reason: <pre> Not Found</pre></p> </body> </html> Time spent: 0:00:00.199 Tylers-MacBook-Pro:6.3.0 tyler$
究竟发生了什么? 我所做的一切都完全遵循我应该做的事情。 谢谢你的帮助。
I am trying to get familiar solr to eventually complete a school project that involves indexing a .csv file. I am following the instructions on the following website: https://lucene.apache.org/solr/5_4_1/quickstart.html and in particular, under the section Indexing CSV (Comma/Column Separated Values). I entered the commands just as specified (except im using solr version 6.3.0) and getting constant errors.
Below is what I entered into terminal:
Tylers-MacBook-Pro:6.3.0 tyler$ solr start Archiving 1 old GC log files to /usr/local/Cellar/solr/6.3.0/server/logs/archived Archiving 1 console log files to /usr/local/Cellar/solr/6.3.0/server/logs/archived Rotating solr logs, keeping a max of 9 generations Waiting up to 180 seconds to see Solr running on port 8983 [-] Started Solr server on port 8983 (pid=20594). Happy searching! Tylers-MacBook-Pro:6.3.0 tyler$ bin/post -c gettingstarted example/exampledocs/books.csv java -classpath /usr/local/Cellar/solr/6.3.0/libexec/dist/solr-core-6.3.0.jar -Dauto=yes -Dc=gettingstarted -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/books.csv SimplePostTool version 5.0.0 Posting files to [base] url http://localhost:8983/solr/gettingstarted/update... Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log POSTing file books.csv (text/csv) to [base] SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/gettingstarted/update SimplePostTool: WARNING: Response: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /solr/gettingstarted/update. Reason: <pre> Not Found</pre></p> </body> </html> SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/gettingstarted/update 1 files indexed. COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update... SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/gettingstarted/update?commit=true SimplePostTool: WARNING: Response: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /solr/gettingstarted/update. Reason: <pre> Not Found</pre></p> </body> </html> Time spent: 0:00:00.199 Tylers-MacBook-Pro:6.3.0 tyler$
What exactly is going on? All I have done is followed exactly what I was supposed to do. Thanks for any help.
原文:https://stackoverflow.com/questions/43100076
最满意答案
预计通过Ajax发布的帖子将无法使用安全组件。
根据http://whatswhat.no/development/framework/cakephp-2/465-making-a-jquery-ajax-call-with-security-component-activated-in-cakephp-2您需要将您的操作添加到安全组件的解锁操作:
public function beforeFilter() { parent::beforeFilter(); $this->Security->unlockedActions = array('ajax_action'); }
It is expected that posts via Ajax will not work with the security component enabled.
According to http://whatswhat.no/development/framework/cakephp-2/465-making-a-jquery-ajax-call-with-security-component-activated-in-cakephp-2 you need to add your action to the Security component's unlocked actions:
public function beforeFilter() { parent::beforeFilter(); $this->Security->unlockedActions = array('ajax_action'); }
相关问答
更多-
最后,我得到了错误,原因是我需要将我发送的JSON数据串联起来。 我必须在XHR对象中设置内容类型和数据类型。 所以正确的版本在这里: $.ajax({ type: 'POST', url: "http://localhost:8080/project/server/rest/subjects", data: JSON.stringify({ "subject:title":"Test Name", "subject:description":"Creating test sub ...
-
POST 400错误,ajax请求(POST 400 error, ajax request)[2022-08-04]
使用ajax上的headers属性传递csrf令牌 $.ajax({ contentType: "application/json; charset=utf-8", dataType: 'json', method: 'POST', url: 'campaignsave', headers: { 'X-CSRF-TOKEN': 'token' } data: data, success: function(data){ alert(data); } }); Pa ... -
使用Jackson的@RequestBody发送ajax文章中的400错误请求(400 Bad Request on ajax post with @RequestBody using Jackson)[2023-03-19]
使用@RequestBody时,您的代码不起作用,因为您的ajax请求未发送json对象。 您需要使用JSON.stringify()在发送JavaScript对象之前对其进行序列化。 你为什么在你的控制器上使用@Service ? 尝试: $.ajax({ type: "POST", url: "vocabulary/createVocabulary", contentType : 'application/json; charset=utf-8', data: JSON. ... -
使用CakePHP导致400响应的AJAX POST请求(黑洞)(AJAX POST request with CakePHP causing 400 response (blackhole))[2024-03-06]
预计通过Ajax发布的帖子将无法使用安全组件。 根据http://whatswhat.no/development/framework/cakephp-2/465-making-a-jquery-ajax-call-with-security-component-activated-in-cakephp-2您需要将您的操作添加到安全组件的解锁操作: public function beforeFilter() { parent::beforeFilter(); $this-> ... -
ajax错误400错误请求(ajax error 400 bad request)[2023-06-17]
如果在yii2项目中启用enableCsrfValidation,则需要向ajax数据添加令牌以使请求生效。 @看到 CSRF CSRF Ajax if you enable enableCsrfValidation in you yii2 project, you need to add a token to ajax data to make the request validate. @see CSRF CSRF Ajax -
您必须显式指定字段fileName , fileSize和description ,因为请求不会自动为您生成它们: import os import requests filepath = 'foo' files = {'file': open(filepath, 'rb')} data = { 'fileName': filepath, 'fileSize': os.path.getsize(filepath), 'description': 'undefined' } res ...
-
您宣布application/json为内容类型。 但是你通过urllib.parse.urlencode()实际编码的是application/x-www-form-urlencoded 。 尝试使用json.dumps()代替。 You are announcing application/json as the content type. But what you are actually encoding through urllib.parse.urlencode() is application ...
-
POST请求响应400(POST request response 400)[2022-11-01]
我建议您使用https://www.charlesproxy.com/等调试代理服务来查看请求是如何进行的。 然后你可以再次使用邮递员提出请求并比较它们以找到它们不同的地方。 I recommend you use a debugging proxy service like https://www.charlesproxy.com/ to see how the request is being made. Then you can make the request with postman again ... -
HTTP 400是Bad Request ,这意味着Django无法理解请求。 尝试添加: dataType: "json", contentType: "application/json" 现在Django会知道你发布了json这就是你要找的东西。 HTTP 400 is Bad Request which means that Django is unable to understand the request. Try adding: dataType: "json", conten ...
-
如果响应代码不是200或2xx,则使用getErrorStream()而不是getInputStream()来解析json并显示后端提供的消息。 If the response code isn't 200 or 2xx, use getErrorStream() instead of getInputStream() to parse the json and show the message provided by your backend.