I have a table named
property which contains one column (propertyNames). Table has around 75000 rows.
My Task :
I want to get all rows in json files. Each of json file should contain 6 records only but alphabetically.
For examples:
a.json should contain records starts with a.
aa.json should contain records starts with aa.
ab.json should contain records starts with ab.
harry.json should contain records starts with harry.
this all I wanted to do for fast search in my application. When user type some words in search box than auto complete will look for matched json file and display records from it. some kind of technique is used for
IMDB search. I am trying to apply the same using static json files.
How does the IMDB search work so fast?
Problem :
So as I said I have 75000 records in table with one column,how do I create small sets of records (datatable with 6 records each) so I can convert that into json files via my applications.
I have tried this using
like
for example :
select * from property where propertyNames like 'a%'
I got 3000 records from 75000 which starts with a.
but i dont want 3000 records should contain in one json file. so again I tried with
like 'a%'
so I got 19 records. again tried with
like 'ab%' got 80 records.
So, this all I have done only for
a. still I don't get a desire result (6 each). Method I am using right now to get desire results which is
very time consuming.
How can I get this records? Is there any logic I need to apply? can you please share any query or logic I need to implement?
Your help will be highly appreciated.
Thanks,
Suraj.