You'll have to be more explicit about the actual data and what didn't work.
Try developing a simple, self-contained unit test with some simple strings
as input that demonstrates the case that you say doesn't work.
I mean, regular expressions and field analysis can both be quite tricky -
even a tiny typo can break everything.
To be clear, my suggested approach to using regular expressions works only
on un-tokenized input, so there won't be any positions or even offsets.
Other than that, you're on your own until you develop that small,
self-contained unit test.
Or, you can file a Jira for a new Lucene Query for phrase and or span
queries that measures distance by offsets rather than positions.
-- Jack Krupansky
-----Original Message-----
From: wgggfiy
Sent: Monday, May 13, 2013 3:47 AM
To: java-user@lucene.apache.org
Subject: Re: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?
Jack, according to you, How can I implemt this requirement ?Could you give
me
a clue ? thank you very much.The regex query seemed not worked ? I got the
field such as FieldType fieldType = new FieldType();
FieldInfo.IndexOptions indexOptions =
FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS;
fieldType.setIndexOptions(indexOptions); fieldType.setIndexed(true);
fieldType.setTokenized(true); fieldType.setStored(true);
fieldType.freeze(); return new Field(name, value, fieldType);
-----
--------------------------
Email: wuqiu.m...@qq.com
--------------------------
--
View this message in context:
http://lucene.472066.n3.nabble.com/PhraseQuery-Can-jakarta-apache-10-be-searched-by-offset-tp4061243p4062852.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org