maxFieldLength actual limit is 1 greater than expected value.
-------------------------------------------------------------
Key: LUCENE-641
URL: http://issues.apache.org/jira/browse/LUCENE-641
Project: Lucene - Java
Issue Type: Bug
Components: Index
Affects Versions: 2.0.0
Environment: JSE 5.0
Reporter: Topbit Du
Priority: Minor
// Prepare document.
Document document = new Document();
document.add(new Field("name",
"pattern oriented software architecture", Store.NO,
Index.TOKENIZED, TermVector.WITH_POSITIONS_OFFSETS));
// Set max field length to 2.
indexWriter.setMaxFieldLength(2);
// Add document into index.
indexWriter.addDocument(document, new StandardAnalyzer());
// Create a query.
QueryParser queryParser = new QueryParser("name", new StandardAnalyzer());
Query query = queryParser.parse("software");
// Search the 3rd term.
Hits hits = indexSearcher.search(query);
Assert.assertEquals(0, hits.length());
// failed. Actual hits.length() == 1, but expect 0.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]