lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Nacional (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-4743) ComplexPhraseQuery highlight problem after rewriting using ComplexPhraseQuery.rewrite(IndexReader)
Date Mon, 04 Feb 2013 00:14:13 GMT

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

Jason Nacional commented on LUCENE-4743:
----------------------------------------

Thanks all for the quick response. I can provide you some sample queries:

Let's say we have the following line: Make Sure Our Emails Reach Your Inbox

the query is: "(Make Sur*) Inbox"~10

after searching, the hits are correct. but somehow "Make" is not being highlighted. Am I missing
something here? here is my code.

{code:title=DocHighlighter.java|borderStyle=solid}
...
Query rewrite_result = phrase.rewrite(IndexReader.open(INDEX_DIR));
QueryScorer qs_phrases = new QueryScorer(rewrite_result);
qs_phrases.setExpandMultiTermQuery(true);
highlighter = new Highlighter(htmlFormatter, qs_phrases);
highlighter.setTextFragmenter(new NullFragmenter());
highlighter.setMaxDocCharsToAnalyze(Integer.MAX_VALUE);
//get the temp text
if(text == null){
text = highlighter.getBestFragment(analyzer, "", pText);
}else{
text_temp = highlighter.getBestFragment(analyzer, "", text);
text = text_temp;
}
...
{code}

I'll start to create a test case for more info.
                
> ComplexPhraseQuery highlight problem after rewriting using ComplexPhraseQuery.rewrite(IndexReader)
> --------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4743
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4743
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/search, modules/queryparser
>    Affects Versions: 3.6.2
>            Reporter: Jason Nacional
>              Labels: complexqueryparser, newbie, queryparser
>
> Just want to ask an assistance using ComplexPhraseQuery. I mean, when it comes to highlighting
the hits are not correct. I also started using ComplexPhraseQueryParser to support complex
proximity searches.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message