Я новичок в Solr (установил его вчера...), и у меня уже есть первая проблема.
У меня есть мой каталог Solr-Indexing
, куда я скопировал post.jar
, и где у меня есть основной каталог Collection1
. В Collection1
у меня есть каталог conf
с schema.xml
, solrconfig.xml
и некоторыми pdf-документами (которые я хочу импортировать/индексировать).
Я запускаю свой экземпляр Solr с java -Dsolr.solr.home="D:/download/Solr-Test/Solr-Indexing" -jar start.jar
(в журнале проблем нет), а затем пытаюсь загрузить PDF-файл в свою коллекцию с помощью команды java -Dtype=application/pdf -Durl=http://localhost:8983/solr/collection1/update/extract -jar post.jar collection1/Lucene.pdf
.
Вывод следующий:
D:\download\Solr-Test\Solr-Indexing>java -Dtype=application/pdf -Durl=http://localhost:8983/solr/collection1/update/extract -jar post.jar collection1/Lucene.pdf
SimplePostTool version 1.5
Posting files to base url http://localhost:8983/solr/collection1/update/extract using content-type application/pdf..
POSTing file Lucene.pdf
SimplePostTool: WARNING: Solr returned an error #404 Not Found
SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/collection1/update/extract
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/collection1/update/extract..
SimplePostTool: WARNING: Solr returned an error #404 Not Found for url http://localhost:8983/solr/collection1/update/extract?commit=true
Time spent: 0:00:00.015
В чем проблема? Я что-то пропустил?
Что я вижу, так это то, что URL-адрес в браузере http://localhost:8983/solr/#/Collection1
с #
, а я использую без #
. Может ли это быть проблемой? Я тоже пытался добавить #
в свою команду, но потом получаю сообщение:
D:\download\Solr-Test\Solr-Indexing>java -Dtype=application/pdf -Durl=http://localhost:8983/solr/#/collection1/update/extract -jar post.jar collection1/Lucene.pdf
SimplePostTool version 1.5
Posting files to base url http://localhost:8983/solr/#/collection1/update/extract using content-type application/pdf..
POSTing file Lucene.pdf
SimplePostTool: WARNING: Solr returned an error #405 HTTP method POST is not supported by this URL
SimplePostTool: WARNING: IOException while reading response: java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8983/solr/#/collection1/update/extract
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/#/collection1/update/extract..
Time spent: 0:00:00.031
Вот мой schema.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="simple" version="1.1">
<types>
<fieldtype name="string" class="solr.StrField"/>
<fieldtype name="long" class="solr.TrieLongField"/>
<fieldtype name='text' class='solr.TextField'>
<analyzer>
<tokenizer class='solr.WhitespaceTokenizerFactory' />
<filter class='solr.LowerCaseFilterFactory' />
</analyzer>
</fieldtype>
</types>
<fields>
<field name="id" type="long" required="true" />
<field name='fullText' type='text' multiValued='true' />
<dynamicField name="*" type="string" multiValued="true" indexed="true" stored="true" />
<copyField source="*" dest="fulltext" />
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>fullText</defaultSearchField>
<solrQueryParser defaultOperator="OR" />
</schema>
и solrconfig.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<luceneMatchVersion>LUCENE_45</luceneMatchVersion>
<directoryFactory name='DirectoryFactory' class='solr.MMapDirectoryFactory' />
<lib dir='${solr.core.instanceDir}\lib' />
<requestHandler name='standard' class='solr.StandardRequestHandler' default='true' />
<requestHandler name="/select" class="solr.SearchHandler" />
<requestHandler name='/update' class='solr.UpdateRequestHandler' />
<requestHandler name='/update/extract' class='solr.extraction.ExtractingRequestHandler'>
<lst name="defaults">
<str name="uprefix">s_meta_</str>
<str name="fmap.content">t_content</str>
<str name="fmap.dcterms:created">d_created</str>
</lst>
</requestHandler>
<requestHandler name='/admin/' class='org.apache.solr.handler.admin.AdminHandlers' />
<admin>
<defaultQuery>*:*</defaultQuery>
</admin>
</config>
Как видите, я на машине с Windows(7).