Solr DataImportHandler is not indexing all data defined

后端 未结 3 1223
我寻月下人不归
我寻月下人不归 2020-12-22 08:53

I am using solr5.3.

I am trying to upload wikipedia page article dump to solr using \"DataImportHandler\" but I am getting only id and title files when i am queryin

相关标签:
3条回答
  • 2020-12-22 09:12

    The provided setting will work fine with classic schema only. But at solrconfig by default managed schema was enabled. Due to which I was not getting text. For managed schema I need not to define "schema.xml" and I should define fields in data-config.xml like below.

     <field column="id"        xpath="/mediawiki/page/id" />
                <field column="title_s"     xpath="/mediawiki/page/title" />
                <field column="revision"  xpath="/mediawiki/page/revision/id" />
                <field column="user_s"      xpath="/mediawiki/page/revision/contributor/username" />
                <field column="userId"    xpath="/mediawiki/page/revision/contributor/id" />
                <field column="text_s"      xpath="/mediawiki/page/revision/text" />
                <field column="timestamp" xpath="/mediawiki/page/revision/timestamp" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'" />
                <field column="$skipDoc"  regex="^#REDIRECT .*" replaceWith="true" sourceColName="text"/>
    
    0 讨论(0)
  • 2020-12-22 09:14

    I was recently trying the same wikipedia import with Solr 7. The reason text isn't returned is because that field in the managed_schema is set to stored="false":

    <field name="text" type="text_en" indexed="true" stored="false"/>
    

    Changing it to stored="true" will return the text.

    The current accepted answer suggests using the text_s field, which was probably stored in the managed_schema of the Solr version OP was using. Note that searching for terms included in any field that is not stored will still return the relevant document, only the text itself is not returned. See the answer here for more info: Solr index vs stored

    0 讨论(0)
  • 2020-12-22 09:23

    My dear friend you have simply mis-typed one of the fields. Try this link and you'd want to laugh and cry at the same time.

    http://localhost:8983/solr/wiki/select?q=*%3A*&fl=id+titleText+user+revision&wt=json&indent=true

    The title you mentioned in the schema is "titleText" and your limit mentioned "title" and "text" seperately. So God speed and you can stay in touch with me via hangouts: porous999@gmail.com

    0 讨论(0)
提交回复
热议问题