solr index for multi-valued multi-type field

后端 未结 1 601
走了就别回头了
走了就别回头了 2021-01-29 00:45

I am indexing a collection of xml document with the next structure:


  1234
  Some Name
  

        
相关标签:
1条回答
  • 2021-01-29 01:08

    I think there is no obvious solution for indexing data coming from the many-to-many relationship. In this case I would go with dynamic fields: http://wiki.apache.org/solr/SchemaXml#Dynamic_fields

    Field definition in schema.xml:

    <dynamicField name="experience_*" type="integer"  indexed="true"  stored="true"/>
    

    So, using your example you would end up with something like this:

    <mydoc>
      <id>1234</id>
      <name>Some Name</name>
      <experience_Java>10</experience_Java>
      <experience_Hadoop>4</experience_Hadoop>
      <experience_Hbase>1</experience_Hbase>
    </mydoc>
    

    Then you can use the following query: fq=experience_Java:[3 to *]

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