[jira] Commented: (LUCENE-2877) BUG in the org.apache.lucene.analysis.br.BrazilianAnalyzer

2011-01-21 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984723#action_12984723
 ] 

Uwe Schindler commented on LUCENE-2877:
---

As the flag you are using says: NOT_ANALYZED will not analyze the Field when 
indexing, it is just added as one token, as you pass. So why is there an bug in 
BrasilianAnalyzer? It's not even used during indexing!

> BUG in the org.apache.lucene.analysis.br.BrazilianAnalyzer
> --
>
> Key: LUCENE-2877
> URL: https://issues.apache.org/jira/browse/LUCENE-2877
> Project: Lucene - Java
>  Issue Type: Bug
>  Components: contrib/analyzers
>Affects Versions: 3.0.2
> Environment: Windows 7 64bits, Eclipse Helios
>Reporter: Renan Pedro Terra de Oliveira
>Priority: Critical
>
> One weird bug with this field is that instead of "false", you have to search 
> for "falsee" to get the correct results.
> The same behavior happen with other fields that stored in the index and not 
> analyzed.
> Example of create fields to indexing:
> Field field = new Field("situacaoDocumento", "ATIVO", Field.Store.YES, 
> Field.Index.NOT_ANALYZED);
> or
> Field field = new Field("copia", "false", Field.Store.YES, 
> Field.Index.NOT_ANALYZED);
> Example search i need to do, but nothing get correct result:
>   IndexSearcher searcher = ...;
>   TopScoreDocCollector collector = ;
> Query query = MultiFieldQueryParser.parse(VERSION, 
> "copia:false", "copia", flags, getAnalyzer());
>   searcher.search(query, collector);
>   ScoreDoc[] hits = collector.topDocs().scoreDocs;
>   if (hits.length > 0) {
>   return searcher.doc(0);
>   }
>   return null;
> Example search i do to work:
>   IndexSearcher searcher = ...;
>   TopScoreDocCollector collector = ;
> Query query = MultiFieldQueryParser.parse(VERSION, 
> "copia:falsee", "copia", flags, getAnalyzer());
>   searcher.search(query, collector);
>   ScoreDoc[] hits = collector.topDocs().scoreDocs;
>   if (hits.length > 0) {
>   return searcher.doc(0);
>   }
>   return null;
> I tested on the Luke (Lucene Index Toolbox) and he prove the bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] Commented: (LUCENE-2877) BUG in the org.apache.lucene.analysis.br.BrazilianAnalyzer

2011-01-20 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984353#action_12984353
 ] 

Robert Muir commented on LUCENE-2877:
-

Hello, I think the issue is that you are using Field.Index.NOT_ANALYZED.

This means the BrazilianAnalyzer is not actually analyzing your text at 
index-time, causing the confusion.


> BUG in the org.apache.lucene.analysis.br.BrazilianAnalyzer
> --
>
> Key: LUCENE-2877
> URL: https://issues.apache.org/jira/browse/LUCENE-2877
> Project: Lucene - Java
>  Issue Type: Bug
>  Components: contrib/analyzers
>Affects Versions: 3.0.2
> Environment: Windows 7 64bits, Eclipse Helios
>Reporter: Renan Pedro Terra de Oliveira
>Priority: Critical
> Fix For: 3.0.4
>
>
> One weird bug with this field is that instead of "false", you have to search 
> for "falsee" to get the correct results.
> The same behavior happen with other fields that stored in the index and not 
> analyzed.
> Example of create fields to indexing:
> Field field = new Field("situacaoDocumento", "ATIVO", Field.Store.YES, 
> Field.Index.NOT_ANALYZED);
> or
> Field field = new Field("copia", "false", Field.Store.YES, 
> Field.Index.NOT_ANALYZED);
> Example search i need to do, but nothing get correct result:
>   IndexSearcher searcher = ...;
>   TopScoreDocCollector collector = ;
>   Query query = new TermQuery(new Term("copia", "false"));
>   searcher.search(query, collector);
>   ScoreDoc[] hits = collector.topDocs().scoreDocs;
>   if (hits.length > 0) {
>   return searcher.doc(0);
>   }
>   return null;
> Example search i do to work:
>   IndexSearcher searcher = ...;
>   TopScoreDocCollector collector = ;
>   Query query = new TermQuery(new Term("copia", 
> "falsee"));
>   searcher.search(query, collector);
>   ScoreDoc[] hits = collector.topDocs().scoreDocs;
>   if (hits.length > 0) {
>   return searcher.doc(0);
>   }
>   return null;
> I tested on the Luke (Lucene Index Toolbox) and he prove the bug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org