简体   繁体   English

在 Lucene 中索引多级 JSON 对象

[英]Indexing Multilevel JSON Objects in Lucene

I am new to Lucene.我是 Lucene 的新手。 I have worked on Lucene search using field value pairs in documents.我曾在文档中使用字段值对进行 Lucene 搜索。 Now there is a requirement to parse some JSON files and Index them up for Lucene search.现在需要解析一些 JSON 文件并索引它们以进行 Lucene 搜索。 I have an idea on working with simple form of JSON file according to this article .根据这篇文章,我有一个关于使用简单形式的 JSON 文件的想法。

But the JSON Structure I have to work with is little more complex than that.但是我必须使用的JSON 结构比这更复杂。 Any kind of idea will be appreciated.任何想法都会受到赞赏。

Thanks.谢谢。

You basically can linearize your json and then index it as in article you've provided.您基本上可以线性化您的 json,然后按照您提供的文章对其进行索引。

For instance, json like this:例如,像这样的 json:

{"key": {"hello": "world"}}

will be transformed into:将转化为:

{"key.hello": "world"}

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

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