Solr returned an error #400 (Bad Request) for url -


i using solr 6.5.0, , came across scenario have index data field may of multiple languages in document.

i trying use separate field each language , have index data of specific language corresponding field defined language.

i have added below config , schema changes:

solr config:

  <requesthandler name="/update" class="solr.updaterequesthandler">        <lst name="defaults">          <str name="update.chain">langid</str>        </lst>         </requesthandler>     <updaterequestprocessorchain name="langid">          <processor class="org.apache.solr.update.processor.tikalanguageidentifierupdateprocessorfactory">            <str name="langid.fl">title</str>            <str name="langid.langfield">lang</str>            <str name="langid.fallback">en</str>          </processor>          <processor class="solr.logupdateprocessorfactory" />          <processor class="solr.runupdateprocessorfactory" />        </updaterequestprocessorchain> 

schema:

<field name="code" type="string" indexed="true" stored="true"/>     <field name="title" type="string" indexed="true" stored="true"/>     <field name="content_english" type="text_english" indexed="true" stored="true"/>     <field name="content_french" type="text_french" indexed="true" stored="true"/>     <field name="content_spanish" type="text_spanish" indexed="true" stored="true"/> 

input xml:

<add> <doc>   <field name="code">one</field>   <field name="title">adventures</field>   <field name="content_english">especially fuzzy search welcome; solr beautiful engine , it’s incredibly fast: millions of documents no problem. of course, if servers capacities configured correctly.</field>     </doc> <doc>   <field name="code">two</field>   <field name="title">aventures</field>   <field name="content_french">surtout la recherche floue est très bienvenue; solr est vraiment un beau moteur et c'est incroyablement rapide: des millions de documents ne posent aucun problème. bien sûr, si les capacités de vos serveurs sont configurées correctement.</field>     </doc> <doc>   <field name="code">three</field>   <field name="title">aventuras</field>   <field name="content_spanish">especialmente la búsqueda difusa es muy bienvenida; solr realmente es un motor hermoso y es increíblemente rápido: millones de documentos no son ningún problema. por supuesto, si las capacidades de los servidores están configuradas correctamente.</field>     </doc> </add> 

whenever update core, i'am getting below error:

c:\solr-6.5.0\example\exampledocs>java -durl=http://localhost:8983/solr/autodetect/update?update.chain=langid -jar post.jar multilanguage.xml simpleposttool version 5.0.0  

posting files [base] url http://localhost:8983/solr/autodetect/update?update.chain=langid using content-type application/xml... posting file multilanguage.xml [base] simpleposttool: warning: solr returned error #400 (bad request) url: http://localhost:8983/solr/autodetect/update?update.chain=langid simpleposttool: warning: response: 4006org.apache.solr.common.solrexceptionorg.apache.solr.common.solrexceptiondocument missing mandatory uniquekey field: id400 simpleposttool: warning: ioexception while reading response: java.io.ioexception: server returned http response code: 400 url: http://localhost:8983/solr/autodetect/update?update.chain=langid 1 files indexed. committing solr index changes http://localhost:8983/solr/autodetect/update?update.chain=langid... time spent: 0:00:00.179

error : id field missing documents.

id used identify each document uniquely specified in schema file below.

<uniquekey>id</uniquekey>   

every document must , should have field specified uniquekey.

include id field docs , check. ex:

<doc>   <field name="id">001</field>   <field name="code">one</field>   <field name="title">adventures</field>   <field name="content_english">especially fuzzy search welcome; solr beautiful engine , it’s incredibly fast: millions of documents no problem. of course, if servers capacities configured correctly.</field>     </doc> 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -