public function find($term, $fields = [])
    {
        Wildcard::setMinPrefixLength($this->minPrefixLength);
        Lucene::setResultSetLimit($this->resultsLimit);

        if (empty($fields)) {
            return [
                'results' => $this->luceneIndex->find($term),
                'query' => $term
            ];
        }

        $fieldTerms[] = new IndexTerm($term);
        foreach ($fields as $field => $fieldText) {
            $fieldTerms[] = new IndexTerm($fieldText, $field);
        }
        return [
            'results' => $this->luceneIndex->find(new MultiTerm($fieldTerms)),
            'query' => $term
        ];
    }
public function find($term, $fields = [])
    {
        Wildcard::setMinPrefixLength($this->minPrefixLength);
        Lucene::setResultSetLimit($this->resultsLimit);

        if (empty($fields)) {
            return [
                'results' => $this->luceneIndex->find($term),
                'query' => $term
            ];
        }

        $fieldTerms[] = new IndexTerm($term);
        foreach ($fields as $field => $fieldText) {
            $fieldTerms[] = new IndexTerm($fieldText, $field);
        }
        return [
            'results' => $this->luceneIndex->find(new MultiTerm($fieldTerms)),
            'query' => $term
        ];
    }
public function find ( $ term , $ fields = [ ] ) { Wildcard :: setMinPrefixLength ( $ this -> minPrefixLength ) ; Lucene :: setResultSetLimit ( $ this -> resultsLimit ) ; if ( empty ( $ fields ) ) { return [ 'results' => $ this -> luceneIndex -> find ( $ term ) , 'query' => $ term ] ; } $ fieldTerms [ ] = new IndexTerm ( $ term ) ; foreach ( $ fields as $ field => $ fieldText ) { $ fieldTerms [ ] = new IndexTerm ( $ fieldText , $ field ) ; } return [ 'results' => $ this -> luceneIndex -> find ( new MultiTerm ( $ fieldTerms ) ) , 'query' => $ term ] ; }
Search page for the term in the index.
@param string $term
@param array $fields (string => string)
@return array ('results' => \ZendSearch\Lucene\Search\QueryHit[], 'query' => string)
Search page for the term in the index .