{"id":752,"date":"2013-06-15T08:34:41","date_gmt":"2013-06-15T06:34:41","guid":{"rendered":"http:\/\/thomasdt.com\/?p=752"},"modified":"2013-06-15T08:34:41","modified_gmt":"2013-06-15T06:34:41","slug":"run-solr-with-a-windows-pc","status":"publish","type":"post","link":"https:\/\/rationalk.ch\/blog\/run-solr-with-a-windows-pc\/","title":{"rendered":"Run Solr with a windows pc"},"content":{"rendered":"<p>This post is more a memo for my self than a tutorial.<\/p>\n<p>Download Solr (http:\/\/lucene.apache.org\/solr\/) to c:\/km\/solr\/<br \/>\nDowload Jetty (http:\/\/www.eclipse.org\/jetty\/) to c:\/km\/jetty\/<br \/>\nDownload Curl (http:\/\/curl.haxx.se\/dlwiz\/?type=bin&amp;os=Win32&amp;flav=-&amp;ver=2000%2FXP) to c:\/km\/curl<\/p>\n<p>Follow this tutorial to run Solr : http:\/\/lucene.apache.org\/solr\/4_3_0\/tutorial.html<\/p>\n<p>Starting Solr : <code>~\/solr\/example$ java -jar start.jar<\/code><br \/>\nIndex All XML documents from the exampledocs folder : <code>~\/solr\/example\/exampledocs$ java -jar post.jar *.xml<\/code><\/p>\n<p>Assume you have a doc file called doc2.doc in the folder, index it using : <code>C:\\km\\solr\\example\\exampledocs&gt; c:\\km\\curl\\curl.exe \"http:\/\/localhost:8983\/solr\/update\/extract?literal.id=doc2&amp;commit=true\" -F \"myfile=@doc2.doc\"<\/code><\/p>\n<p>Don&rsquo;t forget to change the literal.id or it will replace the last document.<\/p>\n<p>To verify that it has been properly indexed go to : http:\/\/localhost:8983\/solr\/collection1\/browse<br \/>\nAnd type in something contained inside the document.<\/p>\n<p>You can do the same with pdf.<\/p>\n<p>To add the filename to the indexed file open :<br \/>\n<code>C:\\km\\solr\\example\\solr\\collection1\\conf\\schema.xml<\/code><br \/>\nand add : <code><field name=\"fullfilename\" type=\"text_general\" indexed=\"true\" stored=\"true\" \/><\/code><br \/>\nThen index a file using :<br \/>\n<code>C:\\km\\solr\\example\\exampledocs&gt; c:\\km\\curl\\curl.exe \"http:\/\/localhost:8983\/solr\/update\/extract?literal.id=doc2&literal.fullfilename=C:\\km\\solr\\example\\docexamples\\doc2.doc&amp;commit=true\" -F \"myfile=@doc2.doc\"<\/code><\/p>\n<p>Even simpler :<br \/>\nIndex a file using :<br \/>\n<code>C:\\km\\solr\\example\\exampledocs&gt; c:\\km\\curl\\curl.exe \"http:\/\/localhost:8983\/solr\/update\/extract?literal.id=doc2&literal.resourcename=C:\\km\\solr\\example\\docexamples\\doc2.doc&amp;commit=true\" -F \"myfile=@doc2.doc\"<\/code>. It will appear directly in velocity !<\/p>\n<p>Now my next step is to find out :<\/p>\n<ul>\n<li>how to index a full windows folder structure<\/li>\n<li>how to link with php<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This post is more a memo for my self than a tutorial. Download Solr (http:\/\/lucene.apache.org\/solr\/) to c:\/km\/solr\/ Dowload Jetty (http:\/\/www.eclipse.org\/jetty\/) to c:\/km\/jetty\/ Download Curl (http:\/\/curl.haxx.se\/dlwiz\/?type=bin&amp;os=Win32&amp;flav=-&amp;ver=2000%2FXP) to c:\/km\/curl Follow this tutorial to run Solr : http:\/\/lucene.apache.org\/solr\/4_3_0\/tutorial.html Starting Solr : ~\/solr\/example$ java -jar start.jar Index All XML documents from the exampledocs folder : ~\/solr\/example\/exampledocs$ java -jar post.jar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[3],"tags":[50,77],"class_list":["post-752","post","type-post","status-publish","format-standard","hentry","category-lifestyle","tag-km","tag-solr"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/posts\/752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/comments?post=752"}],"version-history":[{"count":0,"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/posts\/752\/revisions"}],"wp:attachment":[{"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/media?parent=752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/categories?post=752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rationalk.ch\/blog\/wp-json\/wp\/v2\/tags?post=752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}