簡體   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