Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 320287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:44:23+00:00 2026-05-12T08:44:23+00:00

iam trying to implement an Searchmachine into my site. Iam using Zend_Search_Lucene for this.

  • 0

iam trying to implement an Searchmachine into my site. Iam using Zend_Search_Lucene for this.

The index is created like this :

public function  create($config, $create = true)
{
    $this->_config = $config;

    // create a new index
    if ($create) {
        Zend_Search_Lucene_Analysis_Analyzer::setDefault(
            new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()
        );

        $this->_index = Zend_Search_Lucene::create(APPLICATION_PATH . $this->_config->index->path);
    } else {
        $this->_index = Zend_Search_Lucene::open(APPLICATION_PATH . $this->_config->index->path);
    }
}

{

public function addToIndex($data)   
   $i = 0;

    foreach ($data as $val) {
        $scriptObj = new Sl_Model_Script();
        $scriptObj->title = $val['title'];
        $scriptObj->description = $val['description'];
        $scriptObj->link = $val['link'];
        $scriptObj->tutorials = $val['tutorials'];
        $scriptObj->screenshot = $val['screenshot'];
        $scriptObj->download = $val['download'];
        $scriptObj->tags = $val['tags'];
        $scriptObj->version = $val['version'];
        $this->_dao->add($scriptObj);
        $i++;
    }

    return $i;
}


 /**
     * Add to Index
     *
     * @param Sl_Interface_Model $scriptObj
     */
    public function add(Sl_Interface_Model $scriptObj)
    {

        // UTF-8 for INDEX

        $doc = new Zend_Search_Lucene_Document();
        $doc->addField(Zend_Search_Lucene_Field::text('title', $scriptObj->title, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('tags', $scriptObj->tags, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('version', $scriptObj->version, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('download', $scriptObj->download, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('link', $scriptObj->link));
        $doc->addField(Zend_Search_Lucene_Field::text('description', $scriptObj->description, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('tutorials', $scriptObj->tutorials, 'utf-8'));
        $doc->addField(Zend_Search_Lucene_Field::text('screenshot', $scriptObj->screenshot));
        $this->_index->addDocument($doc);

    }

But when i try to query the index with :

$index->find(‘WordPress 2.8.1’ . ‘*’);

im getting the following error :

“non-wildcard characters are required at the beginning of pattern.”

any ideas how to query for a string like mine ? an query for “wordpress” works like excepted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:44:23+00:00Added an answer on May 12, 2026 at 8:44 am

    Lucene cannot handle leading wildcards, only trailing ones. That is, it does not support queries like ‘tell me everyone whose name ends with ‘att” which would be something like

    first_name: *att

    It only supports trailing wildcards. Tell me everyone whose names end that start with ‘ma’

    first_name: ma*

    See this Lucene FAQ entry:

    http://wiki.apache.org/lucene-java/LuceneFAQ#head-4d62118417eaef0dcb87f4370583f809848ea695

    There IS a workaround for Lucene 2.1 but the developers say it can be “expensive”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to implement a simple JMS(traditional not using springs) code in eclipse using
I am trying to implement a ElGamal-like crypto algorithm using Java's BigInteger objects. q
I am trying to implement the good ol' SELECT @@IDENTITY like: INSERT INTO NewsCategories
I am trying to implement something like this: Clicking on a link, a pop-up
I am trying to implement google authentication on my site using the google federated
I am trying implement a most recent widget into my tumblr post. So far,
I am trying to implement a to-do-list website to practice using Django. In models.py,
I am trying to implement a 2D FFT using 1D FFTs. I have a
I am trying to implement Factorial function via divide and conquer strategy. I used
I am trying to implement a 3D DFT but I am running into some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.