当前位置: 首页 > 知识库问答 >
问题:

如何在solr中进行无键查询

龙高歌
2023-03-14

我是solr的初学者,我发现查询

因此,如何使这个查询工作我的模式是

    <fieldType name="string" class="solr.StrField"  />
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" >
    </fieldType>

    <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
    <fieldtype name="binary" class="solr.BinaryField"/>

    </types>

    <fields><field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> <field name="title" type="text_general" indexed="true" stored="true" multiValued="false"/>
   <field name="genere" type="text_general" indexed="true" stored="true"/>
   <field name="description" type="text_general" indexed="true" stored="true" multiValued="false"/>
   <field name="comments" type="text_general" indexed="true" stored="true" multiValued="true"/>
   <field name="author" type="text_general" indexed="true" stored="true" />
   <field name="publications" type="text_general" indexed="true" stored="true" multiValued="true" />

    </fields>

共有1个答案

柯甫
2023-03-14

我们将必须定义默认搜索字段以进行SOLR操作,而不指定查询中的任何字段。

在solrconfig.xml中定义如下

<requestHandler name="/select" class="solr.SearchHandler">
    <lst name="defaults">
         <str name="echoParams">explicit</str>
         <int name="rows">10</int>
         <str name="df">description comments </str>
    </lst>
</requestHandler>
 类似资料:
  • 问题内容: 如何在jDBI中执行类似的操作? 表: foo(id int,name varchar) 与myBatis中的@SelectProvider相似。 问题答案: 这应该工作: 不要忘记用以下方法注释包含此方法的类: 注解(因为JDBI底层使用Apache StringTemplate进行此类替换)。还要注意,使用此注释,您不能在SQL查询中使用’<’字符而不进行转义(因为它是String

  • 问题内容: 在Hibernate 3中,有没有办法等效于HQL中的以下MySQL限制? 如果可能的话,我不想使用setMaxResults。这肯定在较旧的Hibernate / HQL版本中是可行的,但似乎已经消失了。 问题答案: 几年前,当有人问到为什么它在Hibernate 2中有效但在Hibernate 3中无效时,此消息发布在Hibernate论坛上: 在HQL中,从不支持Limit 子句

  • 问题内容: 我命中了要通过自定义开发层进行Solr的查询,而我在该层中超时的一些查询仍在solr实例中。solr中是否有一个可用于使特定查询超时的参数 问题答案: 如Solr中所述,客户端断开连接后查询继续吗?并写在Solr常见问题解答中 在内部,Solr不会使任何请求超时-它使更新和查询都需要花费很长时间才能完全处理。 但是在FAQ的同一位置 但是,用于运行Solr的servlet容器可能会对所

  • 和使用它的字段: 当使用Solr分析工具时,一切看起来都很好。 查询部分如下: null null

  • 问题内容: 在Hibernate 3中,有没有办法等效于以下HQL中的MySQL限制? 如果可能,我不想使用setMaxResults。这肯定在较旧的Hibernate / HQL版本中是可行的,但似乎已经消失了。 问题答案: 几年前,当有人问到为什么它在Hibernate 2中有效但在Hibernate 3中无效时,此消息发布在Hibernate论坛上: 在HQL中, 从不 支持Limit 子句

  • 问题内容: 此子查询可在SQL Server中使用: 如何在SQL Compact中制作? 谢谢! 问题答案: 试试这个: [编辑:] 我最初像Tomalak一样拥有一个INNER JOIN,但是我意识到这将排除没有事件的用户,而不是向他们显示0。甚至可能是您想要的,但与您的原始内容不符。