ZF-5924: Zend_Search_Lucene_Exception' with message 'Wrong field name.

Issue Type: Bug Created: 2009-03-02T08:00:36.000+0000 Last Updated: 2012-11-20T20:52:42.000+0000 Status: Closed Fix version(s): Reporter: Snakehit (snakehit) Assignee: None Tags: - Zend_Search_Lucene

Related issues: Attachments:



I'm trying to use the sorting mechanism of Zend_Search_Lucene from following documentation:…

<pre class="highlight">
$index = Zend_Search_Lucene::open(path/to/lucene);
$list = $index->find("12","id", SORT_NUMERIC, SORT_DESC);   


<pre class="highlight">
Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Wrong field name.' in /home/httpd/tools/library/Zend-1.7.5/Search/Lucene.php:935

When I watch on that line and print some output like these

<pre class="highlight">
if (!in_array($fieldName, $fieldNames)) {
   echo "

    echo "

    throw new Zend_Search_Lucene_Exception('Wrong field name.');


SORT_NUMERIC isn't a field but a sorting type...

Note: Searching with following code works (without sorting)

<pre class="highlight">
$index = Zend_Search_Lucene::open(path/to/lucene);
$list = $index->find("12"); 


Posted by Alexander Veremyev (alexander) on 2009-03-18T09:58:49.000+0000

'id' is not actually a field in terms of index structure and currently not supported for result set sorting. But it's good idea to add it.

Posted by Snakehit (snakehit) on 2009-04-15T06:05:33.000+0000

This is still an issue in v1.8.0PR. Any idea when this will be fixed?

Posted by Rob Allen (rob) on 2012-11-20T20:52:42.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.


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

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