Issues

ZF-4706: Escaping does not work for * and ?

Issue Type: Bug Created: 2008-10-25T08:14:54.000+0000 Last Updated: 2011-08-26T13:41:04.000+0000 Status: Open Fix version(s): Reporter: Nils Caspar (pencil) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

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

Related issues: - ZF-4581

Attachments:

Description

Steps to reproduce:

<pre class="highlight">
require_once 'Zend/Search/Lucene.php';

$index = Zend_Search_Lucene::create('temp');

$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::text('foo', 'Docu*ent'));
$index->addDocument($doc);

$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::text('foo', 'Document'));
$index->addDocument($doc);

$q = '+foo:Docu\*ent';
echo '$q = ' . $q . "\n";
$hits = $index->find($q);
foreach ($hits as $hit) {
    echo $hit->foo . "\n";
}

$q = '+foo:Docu*';
echo '$q = ' . $q . "\n";
$hits = $index->find($q);
foreach ($hits as $hit) {
    echo $hit->foo . "\n";
}

Excepted result:

<pre class="highlight">
$q = +foo:Docu\*ent
Docu*ent
$q = +foo:Docu*
Document
Docu*ent

Actual result:

<pre class="highlight">
$q = +foo:Docu\*ent
Document
$q = +foo:Docu*
Document
Docu*ent

Comments

Posted by Shaun Farrell (farrelley) on 2011-08-26T13:41:04.000+0000

This is the same type of issue.

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