There is one problem in the query parser that I have just found.
In the Query(string field) method of the QueryParser class, I found this
snippet:
if (clauses.Count == 1 && firstQuery != null)

{

if (true)

return firstQuery;

}

else

{

{

if (true)

return GetBooleanQuery(clauses);

}

}
If the if clause is true, then the GetBooleanQuery is not called. Therefore,
if I extend QueryParser I cannot catch this case in the GetBooleanQuery
method, the flow of method calling (AddClause --> GetBooleanQuery) is
broken. I think you should call GetBooleanQuery in all case in Query(string
field) method, that make the flow of method calling, so that, It will be
comfortable for extending QueryParser

Search Discussions

  • George Aroush at Oct 15, 2006 at 11:37 pm
    Hi,

    Can you please provide an example of how this code is causing you a problem?

    The Java version of this code is exactly the same, and has been the same (in
    both Java and C#) since 1.4 release (maybe earlier but I haven't checked
    that far.)

    Regards,

    -- George Aroush


    -----Original Message-----
    From: Vietpd
    Sent: Friday, October 13, 2006 9:24 PM
    To: 'Archives'
    Subject: Extending Query Parser

    There is one problem in the query parser that I have just found.
    In the Query(string field) method of the QueryParser class, I found this
    snippet:
    if (clauses.Count == 1 && firstQuery != null)

    {

    if (true)

    return firstQuery;

    }

    else

    {

    {

    if (true)

    return GetBooleanQuery(clauses);

    }

    }
    If the if clause is true, then the GetBooleanQuery is not called. Therefore,
    if I extend QueryParser I cannot catch this case in the GetBooleanQuery
    method, the flow of method calling (AddClause --> GetBooleanQuery) is
    broken. I think you should call GetBooleanQuery in all case in Query(string
    field) method, that make the flow of method calling, so that, It will be
    comfortable for extending QueryParser

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouplucene-net-user @
categorieslucene
postedOct 14, '06 at 1:22a
activeOct 15, '06 at 11:37p
posts2
users2
websitelucene.apache.org

2 users in discussion

George Aroush: 1 post Vietpd: 1 post

People

Translate

site design / logo © 2022 Grokbase