得到有一定fieldName的所有lucene的值

编程入门 行业动态 更新时间:2024-10-23 11:30:54
本文介绍了得到有一定fieldName的所有lucene的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

要解决这的我创建了一个问题新的Lucene索引,其中每个领域的所有可能distincted值seperatly索引。

To solve this problem I created a new Lucene index where all possible distincted values of each field are indexed seperatly.

所以这是一个几千的文档具有单个期限的指数。 口要提取的所有值一定期限。例如,我想具有字段名的companyName的所有值。 定义WildcardQuery是关闭的当然不是一个解决方案。无论是枚举所有领域,既节约了正确的字段名的人。

So it's an index with a few thousand docs that have a single Term. I want to extract all the values for a certain term. For example, I would like all values that have the fieldName "companyName". Defining a WildcardQuery is off course not a solution. Neither is enumerating ALL fields and only saving the ones with the correct fieldName.

推荐答案

这应该工作(我需要它,它仍然是在C#)

This should work (I take it it still is in C#)

IndexReader.Open(/* path to index */).Terms(new Term("companyName", String.Empty));

更多推荐

得到有一定fieldName的所有lucene的值

本文发布于:2023-11-30 02:52:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648476.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有一定   fieldName   lucene

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!