Hello!
Here is a solution I come up with. Heavy code, has limitations, but works for
my case.
// parsing query
QueryParser parser = new QueryParser(LUCENE_VERSION, CONTENTS_FIELD, analyzer);
Query q = parser.parse("\"" + QueryParser.escape(phraseText) + "\"");
q = q.rewrite(searcher.getIndexRea
Hello, everyone!
Could anyone please explain how to get offsets for hits? I.e. I have a big text
file and want to find some string in it. As a result of this operation, I need
an array of offsets (in characters) from the beginning of the file for each
occurrence of the string.
As an example,