You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Daniel Naber (JIRA)" <ji...@apache.org> on 2006/07/30 13:57:16 UTC

[jira] Resolved: (LUCENE-641) maxFieldLength actual limit is 1 greater than expected value.

     [ http://issues.apache.org/jira/browse/LUCENE-641?page=all ]

Daniel Naber resolved LUCENE-641.
---------------------------------

    Resolution: Fixed

Thanks for the report, this has now been fixed in SVN trunk.


> 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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org