[Xapian-discuss] Segmentation fault using
XapianDateValueRangeProcessor with php-bindings
Sebastian
cbimax at gmail.com
Wed Sep 26 18:32:24 BST 2007
Hello !!
I'm having a little trouble with Xapian 1.0.2, with php-bindings.
I've built two scripts, the indexer with <opened_data> and
<closed_date> with YYYYMMDD format:
$objDatabase = new XapianWritableDatabase( './test', DB_CREATE_OR_OVERWRITE );
$objDocument = new XapianDocument();
$objDocument->add_value( 1, <opened_date> );
$objDocument->add_value( 1, <closed_date> );
$objDocument->add_posting( <doc_word1>, <word_pos1> );
$objDocument->add_posting( <doc_word2>, <word_pos2> );
...
$objDocument->set_data( <doc_data> );
$objDatabase->add_document( $objDocument )
and the enquirer:
$objDatabase = new XapianDatabase( './test' );
$objStemmer = new XapianStem( 'spanish' );
$objEnquire = new XapianEnquire( $objDatabase );
$objParser = new XapianQueryParser();
$objParser->set_database( $objIndexDB );
$objParser->set_stemmer( $objStemmer );
$objParser->add_valuerangeprocessor( new XapianDateValueRangeProcessor(1) );
$objParser->set_default_op( OP_AND );
$objQuery = $objParser->parse_query( <query>,
XapianQueryParser::FLAG_BOOLEAN_ANY_CASE );
$objEnquire->set_query( $objQuery );
$objEnquire->set_sort_by_value_then_relevance( 3, False );
$objMatches = $objEnquire->get_mset( 0, 10 );
...
The enquirer scripts hits a 'Segmentation fault' when issuing
$objParser->parse_query(), with <query> 'example 20010101..20070101'.
It runs OK any query with other words or phrases except a range...
When I remove $objParser->add_valuerangeprocessor( ... ) it goes
flawless.
Any clue ?? Thanks in advance.
Sebastian
More information about the Xapian-discuss
mailing list