【问题标题】:Lucene Grails Searchable plugin build index for part of the tableLucene Grails Searchable plugin build index for part of the table
【发布时间】:2013-02-26 18:56:33
【问题描述】:

我有一个可搜索的域类映射到具有标志列的表。目前,当 Lucene 创建索引时,它会生成这样的查询(返回表中的所有数据):

        select this_.id as id0_0_, 
               this_.flag as flag2_0_0_, 
               this_.email as email0_0_, this_.first_name as first6_0_0_, this_.last_name as last8_0_0_ 
        from ais_person this_ 
        order by this_.id asc

是否可以只为那些包含特定标志值的行建立索引,以便生成的查询如下所示:

    select this_.id as id0_0_, 
           this_.flag as flag2_0_0_, 
           this_.email as email0_0_, this_.first_name as first6_0_0_, this_.last_name as last8_0_0_ 
    from ais_person this_ 
    where this_.flag = 'Y' 
    order by this_.id asc

【问题讨论】:

    标签: grails lucene searchable compass-lucene


    【解决方案1】:

    是的,我认为你可以做到。以下是伪代码。

       Document doc = new Document();
    doc.add(Field.Text("flag", Y));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      • 2012-11-23
      • 2014-12-06
      • 2020-07-06
      • 2018-11-16
      • 1970-01-01
      • 2013-03-01
      相关资源
      最近更新 更多