在Lucene中索引多级JSON对象 [英] Indexing Multilevel JSON Objects in Lucene

查看:400
本文介绍了在Lucene中索引多级JSON对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Lucene的新手.我曾使用文档中的字段值对进行Lucene搜索.现在,需要解析一些JSON文件并将它们编入索引以进行Lucene搜索.我有一个根据此文件的简单格式的JSON文件的想法文章.

I am new to Lucene. I have worked on Lucene search using field value pairs in documents. Now there is a requirement to parse some JSON files and Index them up for Lucene search. 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. Any kind of idea will be appreciated.

谢谢.

推荐答案

基本上,您可以线性化json,然后按照提供的文章对其进行索引.

You basically can linearize your json and then index it as in article you've provided.

例如,像这样的json:

For instance, json like this:

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

将被转换为:

{"key.hello": "world"}

这篇关于在Lucene中索引多级JSON对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆