I have a Spring-based Java webapp. And my problem is:
I have a file which has 34MB and has 2.7 million lines. Lines are just single words one after another:
abc
abcdfg
xyz
etc
I need to choose 15 random unique lines from this file which are not next to each other in a quite fast way. I know that to search such a big files I can use Apache Lucene. Do you know if Lucene can get for me these random lines. Or maybe you have some other idea that can help me to solve this problem.
I would really appreciate any help
Thanks in advance
EDIT:
Or maybe just put this file into database [PostgreSQL]?