繁体   English   中英

表的一部分的Lucene Grails可搜索插件构建索引

[英]Lucene Grails Searchable plugin build index for part of the table

我有一个可搜索的域类,映射到具有标志列的表。 当前,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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM