Re: Is it possible to combine Wildcard and Phrasequery for the Queryparser

2011-10-13 Thread Dmitry Savenko
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

How to get hit offsets?

2011-09-12 Thread Dmitry Savenko
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,