0

所有其他字段都有导入的数据,但是当我搜索所有结果时我没有看到 company_logo 字段,即,这是我的数据配置文件

    <?xml version="1.0" encoding="UTF-8" ?>
    <dataConfig>
     <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
                         url="jdbc:mysql://localhost:3306/demandfire" 
                            user="root" password=""/>
     <document>
        <entity name="core4" 
              query="select company.company_name,demand.id,demand.issue,
            demand.suggestion,demand.title,demand.company_id,company.logo from              company,demand 
            where demand.company_id = company.id;
        ">

            <field column="demand.id" name="id"/> 
            <field column="demand.issue" name="issue"/>
            <field column="demand.suggestion" name="suggestion"/>
            <field column="demand.title" name="title"/>
            <field column="demand.company_id" name="company_id"/>
            <field column="company.company_name" name="company_name"/>
            <field column="company.logo" name="company_logo"/>

         </entity>
     </document>
    </dataConfig>

以下是我的架构文件,问题出现在字段 company_logo 中,我已在 data-config 文件中正确映射它,所有其他字段都能够获取数据但此字段无法获取数据,此(徽标)字段中的示例条目mysql 表属于这种类型 '6bf38f4e-a9af-40b8-af04-2b90d3c93f1f.jpg'

    <schema name="example core one" version="1.1">
      <types>
       <fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

       <fieldType name="string_lowercase" class="solr.TextField" sortMissingLast="true" omitNorms="true">
        <analyzer type="query">
            <tokenizer class="solr.KeywordTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType>

      </types>

     <fields>   
      <!-- general -->

      <field name="id" type="string"    indexed="true"  stored="true"  multiValued="false" required="true"/>
      <field name="issue" type="string_lowercase"    indexed="true"  stored="true"  multiValued="false" required="true"/>
      <field name="suggestion" type="string_lowercase" indexed = "true" stored="true" multivalued="false" required = "true"/>
      <field name="title" type="string_lowercase" indexed = "true" stored="true" multivalued="false" required = "true"/>
      <field name="company_id" type="string" indexed = "true" stored="true" multivalued="false" required = "true"/>
      <field name="company_name" type="string_lowercase" indexed = "true" stored="true" multivalued="false" required = "true"/>
      <field name="company_logo" type="string" indexed = "true" stored="true" multivalued="false" required = "false"/>

     </fields>



     <!-- field to use to determine and enforce document uniqueness. -->
     <uniqueKey>id</uniqueKey>

     <!-- field for the QueryParser to use when an explicit fieldname is absent -->
     <defaultSearchField>title</defaultSearchField>

     <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
     <solrQueryParser defaultOperator="OR"/>
    </schema>*
4

1 回答 1

0

尝试删除字段中的 required="false" 属性(无论如何它应该是默认值)。

尝试使用以下方法更改字段的定义:

<field name="company_logo" type="string" indexed = "true" stored="true" multivalued="false"/>
于 2013-08-01T07:57:25.363 回答