Good Day!
In Java, is there any way to search a large JSON by keys efficiently.
My Sample JSON:
{
"my_data": [
{
"id": "12",
"message": "z1",
"text": "hai"
},
{
"id": "13",
"message": "z2",
"text": "get"
},
{
"id": "14",
"message": "z3",
"text": "up"
}
]
}
The ‘my_data’ JsonArray is very lengthy. As it is very large, it takes more time to search a particular word in it as:
my_data.get(index).getString("text").contains(SEARCH_STRING)
Is there any pre-defined libraries or standard technique to search efficiently?
Thank you.
Since it is pure text data, you can process them with standard text search tools like Lucene, and find your entry based on that.