You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Yanna Kang (Created) (JIRA)" <de...@uima.apache.org> on 2012/01/10 16:33:39 UTC

[jira] [Created] (UIMA-2327) Prospective Search in Lucas

Prospective Search in Lucas
---------------------------

                 Key: UIMA-2327
                 URL: https://issues.apache.org/jira/browse/UIMA-2327
             Project: UIMA
          Issue Type: Question
          Components: Sandbox-Lucas
    Affects Versions: 2.3.1Addons
            Reporter: Yanna Kang


I would like to use UIMA Lucas to perform a prospective search. When the search query is a phrase query, ProspectiveSearchAE.process() could not find the matching tokens even if there are matches in the document. It worked well for boolean queries.

In org.apache.uima.lucas.ProspectiveSearchAE line 189, the original code is scorer.init(tokenStream). I suspect that we need to do tokenStream = scorer.init(tokenStream). The original tokenStream was consumed in the scorer.init(tokenStream). If we want to consume it again (as the code did), we need to use the returned tokenStream, which has been reset to the beginning.

I am a newbie to Lucas. Please correct me if I am wrong.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (UIMA-2327) Prospective Search in Lucas

Posted by "Joern Kottmann (Commented) (JIRA)" <de...@uima.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13185518#comment-13185518 ] 

Joern Kottmann commented on UIMA-2327:
--------------------------------------

Sounds like a bug to me. Do you want to provide a patch?

JavaDoc is here:
http://lucene.apache.org/java/2_9_1/api/contrib-highlighter/org/apache/lucene/search/highlight/QueryScorer.html#init(org.apache.lucene.analysis.TokenStream)

There it says it could also return null, in this case we need to continue using the existing TokenStream. 
                
> Prospective Search in Lucas
> ---------------------------
>
>                 Key: UIMA-2327
>                 URL: https://issues.apache.org/jira/browse/UIMA-2327
>             Project: UIMA
>          Issue Type: Question
>          Components: Sandbox-Lucas
>    Affects Versions: 2.3.1Addons
>            Reporter: Yanna Kang
>
> I would like to use UIMA Lucas to perform a prospective search. When the search query is a phrase query, ProspectiveSearchAE.process() could not find the matching tokens even if there are matches in the document. It worked well for boolean queries.
> In org.apache.uima.lucas.ProspectiveSearchAE line 189, the original code is scorer.init(tokenStream). I suspect that we need to do tokenStream = scorer.init(tokenStream). The original tokenStream was consumed in the scorer.init(tokenStream). If we want to consume it again (as the code did), we need to use the returned tokenStream, which has been reset to the beginning.
> I am a newbie to Lucas. Please correct me if I am wrong.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (UIMA-2327) Prospective Search in Lucas

Posted by "Yanna Kang (Commented) (JIRA)" <de...@uima.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-2327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13191269#comment-13191269 ] 

Yanna Kang commented on UIMA-2327:
----------------------------------

Thank you very much for the reply.

Yes. You are right. The init method could also return null. For now, I used a temporary solution as below. It works fine.

TokenStream newTokenStream;
newTokenStream = scorer.init(tokenStream);
if (newTokenStream != null) {
  tokenStream = newTokenStream;
}

Please correct me if I am wrong.
                
> Prospective Search in Lucas
> ---------------------------
>
>                 Key: UIMA-2327
>                 URL: https://issues.apache.org/jira/browse/UIMA-2327
>             Project: UIMA
>          Issue Type: Question
>          Components: Sandbox-Lucas
>    Affects Versions: 2.3.1Addons
>            Reporter: Yanna Kang
>
> I would like to use UIMA Lucas to perform a prospective search. When the search query is a phrase query, ProspectiveSearchAE.process() could not find the matching tokens even if there are matches in the document. It worked well for boolean queries.
> In org.apache.uima.lucas.ProspectiveSearchAE line 189, the original code is scorer.init(tokenStream). I suspect that we need to do tokenStream = scorer.init(tokenStream). The original tokenStream was consumed in the scorer.init(tokenStream). If we want to consume it again (as the code did), we need to use the returned tokenStream, which has been reset to the beginning.
> I am a newbie to Lucas. Please correct me if I am wrong.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira