首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Solr indexer...SolrException:Bad请求

Solr indexer...SolrException:Bad请求
EN

Stack Overflow用户
提问于 2013-02-11 14:39:54
回答 1查看 2.8K关注 0票数 0

启动solrindex时,我有一个异常org.apache.solr.common.SolrException: Bad Request --这是hadoop.log文件内容

代码语言:javascript
复制
...
2013-02-11 17:01:22,079 INFO  anchor.AnchorIndexingFilter - Anchor deduplication is: off
2013-02-11 17:01:22,079 INFO  indexer.IndexingFilters - Adding org.apache.nutch.indexer.anchor.AnchorIndexingFilter
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: content dest: content
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: title dest: title
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: host dest: host
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: segment dest: segment
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: boost dest: boost
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: digest dest: digest
2013-02-11 17:01:22,222 INFO  solr.SolrMappingReader - source: tstamp dest: tstamp
2013-02-11 17:01:22,223 INFO  solr.SolrMappingReader - source: url dest: id
2013-02-11 17:01:22,223 INFO  solr.SolrMappingReader - source: url dest: url
2013-02-11 17:01:23,940 INFO  solr.SolrWriter - Indexing 250 documents
2013-02-11 17:01:23,952 INFO  solr.SolrWriter - Deleting 0 documents
2013-02-11 17:01:24,780 WARN  mapred.LocalJobRunner - job_local_0001
org.apache.solr.common.SolrException: Bad Request

Bad Request

 request: http://localhost:8080/solr/update?wt=javabin&version=2
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:427)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:249)
at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
at org.apache.nutch.indexer.solr.SolrWriter.write(SolrWriter.java:124)
at org.apache.nutch.indexer.IndexerOutputFormat$1.write(IndexerOutputFormat.java:55)
at org.apache.nutch.indexer.IndexerOutputFormat$1.write(IndexerOutputFormat.java:44)
at     org.apache.hadoop.mapred.ReduceTask$OldTrackingRecordWriter.write(ReduceTask.java:457)
at org.apache.hadoop.mapred.ReduceTask$3.collect(ReduceTask.java:497)
at org.apache.nutch.indexer.IndexerMapReduce.reduce(IndexerMapReduce.java:304)
at org.apache.nutch.indexer.IndexerMapReduce.reduce(IndexerMapReduce.java:53)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:519)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:420)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:260)
2013-02-11 17:01:25,330 ERROR solr.SolrIndexer - java.io.IOException: Job failed!

我想我的schema.xml有点问题--这就是

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" ?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or
    more contributor license agreements. See the NOTICE file
    distributed with this work for additional information regarding
    copyright ownership. The ASF licenses this file to You under the
    Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain
    a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0 Unless required by
    applicable law or agreed to in writing, software distributed
    under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions
    and limitations under the License.
-->
<!--
    Description: This document contains Solr 3.1 schema definition to
    be used with Solr integration currently build into Nutch. See
    https://issues.apache.org/jira/browse/NUTCH-442
    https://issues.apache.org/jira/browse/NUTCH-699
    https://issues.apache.org/jira/browse/NUTCH-994
    https://issues.apache.org/jira/browse/NUTCH-997
    https://issues.apache.org/jira/browse/NUTCH-1058
    https://issues.apache.org/jira/browse/NUTCH-1232
    and
    http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/
    example/solr/conf/schema.xml?view=markup
    for more info.
-->
<schema name="nutch" version="1.5">
<types>
    <fieldType name="string" class="solr.StrField" sortMissingLast="true"
        omitNorms="true"/> 
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0"
        omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
        omitNorms="true" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0"
        omitNorms="true" positionIncrementGap="0"/>

    <fieldType name="text" class="solr.TextField"
        positionIncrementGap="100">
        <analyzer>
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.StopFilterFactory"
                ignoreCase="true" words="stopwords.txt"/>
            <filter class="solr.WordDelimiterFilterFactory"
                generateWordParts="1" generateNumberParts="1"
                catenateWords="1" catenateNumbers="1" catenateAll="0"
                splitOnCaseChange="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.EnglishPorterFilterFactory"
                protected="protwords.txt"/>
            <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        </analyzer>
    </fieldType>
    <fieldType name="url" class="solr.TextField"
        positionIncrementGap="100">
        <analyzer>
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.WordDelimiterFilterFactory"
                generateWordParts="1" generateNumberParts="1"/>
        </analyzer>
    </fieldType>
</types>
<fields>
    <field name="id" type="string" stored="true" indexed="true"/>
<!--    <field name="site" type="string" stored="false" indexed="true"/>  -->
    <!-- core fields -->
    <field name="segment" type="string" stored="true" indexed="false"/>
    <field name="digest" type="string" stored="true" indexed="false"/>
    <field name="boost" type="float" stored="true" indexed="false"/>

    <!-- fields for index-basic plugin -->
    <field name="host" type="string" stored="false" indexed="true"/>
    <field name="url" type="url" stored="true" indexed="true"
        required="true"/>
    <field name="content" type="text" stored="false" indexed="true"/>
    <field name="title" type="text" stored="true" indexed="true"/>
    <field name="cache" type="string" stored="true" indexed="false"/>
    <field name="tstamp" type="date" stored="true" indexed="false"/>

    <!-- fields for index-anchor plugin -->
    <field name="anchor" type="string" stored="true" indexed="true"
        multiValued="true"/>

    <!-- fields for index-more plugin -->
    <field name="type" type="string" stored="true" indexed="true"
        multiValued="true"/>
    <field name="contentLength" type="long" stored="true"
        indexed="false"/>
    <field name="lastModified" type="date" stored="true"
        indexed="false"/>
    <field name="date" type="date" stored="true" indexed="true"/>

    <!-- fields for languageidentifier plugin -->
    <field name="lang" type="string" stored="true" indexed="true"/>

    <!-- fields for subcollection plugin -->
    <field name="subcollection" type="string" stored="true"
        indexed="true" multiValued="true"/>

    <!-- fields for feed plugin (tag is also used by microformats-reltag)-->
    <field name="author" type="string" stored="true" indexed="true"/>
    <field name="tag" type="string" stored="true" indexed="true" multiValued="true"/>
    <field name="feed" type="string" stored="true" indexed="true"/>
    <field name="publishedDate" type="date" stored="true"
        indexed="true"/>
    <field name="updatedDate" type="date" stored="true"
        indexed="true"/>

    <!-- fields for creativecommons plugin -->
    <field name="cc" type="string" stored="true" indexed="true"
        multiValued="true"/>

<!--    <field name="Metatags" type="string" stored="true" indexed="true" multiValued="true"/> -->

</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>content</defaultSearchField>
<solrQueryParser defaultOperator="OR"/>

我将schema.xml从nutch/conf文件夹处理到solr/conf,现在我使用的是Nutch1.6Solr3.6.2和apache 6.0.36……我认为我将帮助理解这个问题。我在apahce日志文件中没有任何错误。我用solr-solrj-3.6.2.jar从solr/dist/文件夹中更改了nutch/lib文件夹中的solr-solrj-3.4.jar文件。

我可以显示我的solrindex-mapping.xml

代码语言:javascript
复制
<mapping>
<!-- Simple mapping of fields created by Nutch IndexingFilters
     to fields defined (and expected) in Solr schema.xml.

         Any fields in NutchDocument that match a name defined
         in field/@source will be renamed to the corresponding
         field/@dest.
         Additionally, if a field name (before mapping) matches
         a copyField/@source then its values will be copied to 
         the corresponding copyField/@dest.

         uniqueKey has the same meaning as in Solr schema.xml
         and defaults to "id" if not defined.
     -->
<fields>
    <field dest="content" source="content"/>
    <field dest="title" source="title"/>
    <field dest="host" source="host"/>
    <field dest="segment" source="segment"/>
    <field dest="boost" source="boost"/>
    <field dest="digest" source="digest"/>
    <field dest="tstamp" source="tstamp"/>
    <field dest="id" source="url"/>
    <copyField source="url" dest="url"/>
</fields>
<uniqueKey>id</uniqueKey>
</mapping>

谢谢你的建议。

EN

回答 1

Stack Overflow用户

发布于 2014-09-02 17:16:29

使用Nutch配置(nutch-default.xml)设置临时目录的路径:

代码语言:javascript
复制
<property>
 <name>mapred.temp.dir</name>
 <value>/tmp</value>
 <description>A shared directory for temporary files.</description>
</property>

参考资料

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14814315

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档