I tried to use WildcardFilter so i sub-classed QueryParser and reimplemented
getWildcardQuery function

CL_NS(search)::Query* WildQueryParser::getWildcardQuery(const TCHAR* _field,
TCHAR* termStr)

{

    Query * query =  QueryParser::getWildcardQuery(_field, termStr);

    const char * objectName = query->getObjectName();

    if(strcmp(objectName, "WildcardQuery") == 0)

    {

//        _CLDELETE(objectName);

        Term* t = _CLNEW Term(_field, termStr);

        WildcardFilter * f = new WildcardFilter(t);

        Query* q = new ConstantScoreQuery(f);

//        _CLDELETE(t);

        return q;

    }

//    _CLDELETE(objectName);

    return query;// now query is not wildcardQuery so i will return it as it is.

}


and it searches without any errors and return the results correctly.
but when i tried to highlight search results i got the following error

terminate called after throwing an instance of 'std::logic_error'

what(): basic_string::_S_construct NULL not valid


so i tried to debug and see where is the problem but i am lost in code but i
think the problem

is in the function


TextFragment** Highlighter::getBestTextFragments(

        StringBuffer* writeTo,

        TokenStream * tokenStream,

        const TCHAR* text,

        bool mergeContiguousFragments,

        int32_t maxNumFragments)


I tried to debug this function many times , I don't know if i am doing
something wrong or not?

Mohammad Ismael
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to