You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Amol Suryawanshi <am...@qualitiasoft.com> on 2021/06/17 10:48:15 UTC
Need approach to store JSON data in Lucene index
Hi Team,
We are using Lucene Java library in our organization to store JSON files data into to Lucene indexes.
Our JSON file are structured in below format.
1. Testcase has several Testcase steps
2. Testcase has several Tasks
3. Tasks has task step
4. Task step has Actions and objects
Testcase
TCSteps
- Actions
- Objects
TASK
TaskSteps
- Actions
- Objects
How should I store this tree like data where I can get any parent document or child document using Lucene query
for eg: I want to get all the Testcases in which particular action is mapped.
Thanks & Regards
Amol A. Suryawanshi
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Re: Need approach to store JSON data in Lucene index
Posted by Adrien Grand <jp...@gmail.com>.
In general, the preferred approach is denormalizing, but your description
suggests that you want to be able to query anything: actions, tasks, test
cases, etc. so I guess that the most natural approach would be to leverage
Lucene's support for index-time joins, see the documentation of the join
package
<https://lucene.apache.org/core/8_8_1/join/org/apache/lucene/search/join/package-summary.html>
.
On Thu, Jun 17, 2021 at 3:45 PM Amol Suryawanshi <
amol.suryawanshi@qualitiasoft.com> wrote:
> Hi Team,
>
> We are using Lucene Java library in our organization to store JSON files
> data into to Lucene indexes.
>
> Our JSON file are structured in below format.
>
>
> 1. Testcase has several Testcase steps
> 2. Testcase has several Tasks
> 3. Tasks has task step
> 4. Task step has Actions and objects
>
> Testcase
> TCSteps
> - Actions
> - Objects
> TASK
> TaskSteps
> - Actions
> - Objects
>
>
> How should I store this tree like data where I can get any parent document
> or child document using Lucene query
>
> for eg: I want to get all the Testcases in which particular action is
> mapped.
>
> Thanks & Regards
> Amol A. Suryawanshi
>
> Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
--
Adrien