Issues

ZF-4581: Search query with escaped special character doesn't work

Issue Type: Bug Created: 2008-10-13T01:26:41.000+0000 Last Updated: 2011-08-26T13:41:04.000+0000 Status: Open Fix version(s): Reporter: Sebastian Volland (sebv) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: - ZF-4706

Attachments:

Description

Reproducible with the following code:

<pre class="literal">
<?php

require_once('Zend/Search/Lucene.php');

$index = Zend_Search_Lucene::create('/tmp/index');

$doc = new Zend_Search_Lucene_Document;
$doc->addField(Zend_Search_Lucene_Field::Text('title', 'test123', 'UTF-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('contents', 'test huhu ? 123', 'UTF-8'));
$index->addDocument($doc);
$index->commit();

/* returns 0 results */
$r = $index->find('\\');
echo count($r) . "\n";

/* returns 0 results */
$r = $index->find('\\?');
echo count($r) . "\n";

/* returns 0 results */
$r = $index->find('123');
echo count($r) . "\n";

/* returns 1 result */
$r = $index->find('huhu');
echo count($r) . "\n";

The first search query produces a PHP notice:

<pre class="literal">
PHP Notice:  Undefined offset:  1 in /opt/sevenval/fit80/lib/php/Zend/Search/Lucene/Search/QueryLexer.php on line 477

The second and the third queries don't return any results.

Comments

Posted by Nicolas Huguet (nicolas.huguet) on 2008-11-27T01:01:33.000+0000

Whe have the same problem : we can't search for the string "c++" in our documents. The query $index->find('c++') returns exactly the same results than the query $index->search('c++')

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts