This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: Search plugins
 Topic: sfLucene 1.1 beta + symfony 1.1 : problem while (re)building
sfLucene 1.1 beta + symfony 1.1 : problem while (re)building [message #59138] Wed, 20 August 2008 16:42
oncletom  is currently offline oncletom
Messages: 2
Registered: January 2008
Location: Bordeaux, France
Junior Member
Hello,

as I wrote it in the title, I use sfLucene 1.1 as it is actually the most suitable search plugin for symfony 1.1 (kick me if I'm wrong). I can't affort sfSearch as I read it was not recommended for production.

So, here is what I've done so far :
* installed the plugin from SVN
* initialized the plugin (`symfony lucene-init front`)
* setup my /config/search.yml and /app/front/config/search.yml
* tried to initialize the index with `symfony lucene:rebuild front`

And I've got this error while rebuilding (or with lucene:clean by the way) :
Fatal error: Call to undefined method sfConfigCache::getinstance() in /home/profile/workspace/project/plugins/sfLucenePlugin/lib/sfLucene.class.php on line 154


I did a symfony cc ; retried, same result.
Also, I commented out the
$this->bootstrapSymfony($app, $env, true);
line in sfLuceneBaseTask as it causes errors. I searched for the bootstrapping method but I found it nowhere.

Also, I notice that in cache/front/.../config, I don't have my config_search.yml.php.

Anyone here has an idea ? It's difficult to make running sfLucene on symfony 1.1 :-/

Thanks
 Topic: sfSearch and Nutch
sfSearch and Nutch [message #60928] Sat, 13 September 2008 15:34
sh1ny  is currently offline sh1ny
Messages: 16
Registered: June 2008
Junior Member
Hello,

I am looking into integrating sfSearch + sfLucene with Nutch created indexes. Can anyone who has any idea how to do that, give me a heads up ? I have already generated the indexes from Nutch, but i have a SiteSearch.class.php like this :

<?php

/**
 * SiteSearch search index.
 *
 * @package     sfSearch
 * @subpackage  search
 * @author      Your name here
 * @version     SVN: $Id$
 */
class SiteSearch extends xfIndexSingle
{
  /**
   * Configures initial state of search index by setting a name.
   *
   * @see xfIndex
   */
  protected function initialize()
  {
    $this->setName('SiteSearch');
  }

  /**
   * Configures the search index by setting up a search engine and service
   * registry.
   *
   * @see xfIndex
   */
  protected function configure()
  {
    // The ->configure() method setups the search index so it knows how to
    // behave.  You must setup a search engine and a search registry so the
    // index knows whats to index and how to index it.
    //
    // This method is analogous to ->configure() in sfForm.  In fact, it has the
    // same purpose and follows similar logic.
    //
    // Consider the following examples as you setup your index:
    //
    // Setup the backend engine:
    //
    //    $this->setEngine(new MyEngine('...'));
    //.
    // Setup the services:
    //
    //    $s1 = new xfService(new MyIdentifier('...'));
    //    $s1->addBuilder(new MyBuilder(array(
    //                                        new xfField('foo', xfField::KEYWORD),
    //                                        new xfField('bar', xfField::TEXT)
    //                                  ));
    //    $s1->addRetort(new xfRetortField);
    //    $s1->addRetort(new xfRetortRoute('module/action?param=%foo%'));
    //
    //    $this->getServiceRegistry()->register($s1);
    //
    // Repeat for each service you require.
    //
    // After you have configured the index, you should populate it.  Do this by
    // running the symfony task:
    //..
    //    $ ./symfony search:populate SiteSearch
    //.
    // For more information, please see the documentation included in the
    // sfSearch package.
    $this->setEngine(new xfLuceneEngine(sfConfig::get('sf_data_dir') . '/crawl/index'));
  }
}


I am not sure what should i add next, since all the examples are for integrating with Propel.
 Topic: sfLucene problem fields with emphasis
icon5.gif  sfLucene problem fields with emphasis [message #62513] Tue, 07 October 2008 12:01
slebrequier  is currently offline slebrequier
Messages: 1
Registered: October 2008
Location: http://bokunosekai.files....
Junior Member
Hello everybody.

I'm new on this forum and I've got a problem with the sfLucenePlugin.

I am making indexes out of a database containing fields with emphasis. The problem is that these fields are ignored by the search action.

Has anybody already encountered this problem ?
Do you have any suggestion ?
Have I forgotten something in my configuration file ?

search.yml:

MyIndex:
  index:
    encoding: UTF-8
    analyzer: utf8num
    case_sensitive: off
    mb_string: on
  models:
    Hotel:
      fields:
        nomesc: unindexed
        nom:
          boost: 1.5
          type: text
        description:
          type: text
        informations:
          type: text
      title: nom
      description: description

[Updated on: Tue, 07 October 2008 12:03]

 Topic: backend generator for module.yml
icon4.gif  backend generator for module.yml [message #65116] Thu, 13 November 2008 11:31
gronsoft  is currently offline gronsoft
Messages: 2
Registered: October 2008
Location: Poland
Junior Member

Hello
i have some $variables in post/config/module.yml
like:
all:      # Setting for all environments
  postNb: 17
  postLimit: 14


now i need "user friendly" administrator for all module.yml files
like init-generator but for module.yml files.

[Updated on: Thu, 13 November 2008 11:33]

 Topic: sfluceneplugin: problem with index synchronization
sfluceneplugin: problem with index synchronization [message #65323] Mon, 17 November 2008 00:38
mikaelsf  is currently offline mikaelsf
Messages: 1
Registered: November 2008
Junior Member
Hi,

I installed sfLucenePlugin. I followed the intructions of the readme:
: symfony lucene-init myapp
: symfony cc
creating the search.yml files: one for the project, one for the frontend, and one for the backend (both on the same model class)
then
: symfony lucene-rebuild myapp

All this works fine, I get the index build, and am able to search and find items present in db at the moment I run lucene-rebuild.

Then I added at the end of my Item model:
sfLucenePropelBehavior::getInitializer()->setupModel('Item');
and enabled propel behaviour:
in myProject/config/propel:
propel.builder.addBehaviors = true

However, when I create a new Item, it does not get into the index. (index count shown by lucene-about frontend remains the same, and the new Item does not show up in search results.
I tried to see if the model was registered in propel's behavior before saving - it does, and seems to do so without error. (for what I saw when tracking the execution flow of the setupModel function)
But when the "save" function of my model is called, it does not seem to trigger any lucene behavior methods.

I also tried to rebuild the model afterwards, it does not seem to help

I also tried to track the condition "addBehaviors" (I only found the following:
if(DataModelBuilder::getBuildProperty('builderAddBehaviors') ")
in the propel module - but none of the code checking that condition seems to be run. However I don t really now the internal of propel so I may simply not searched at the right place.

Any idea what may be the problem?

myproject/config/search.yml:
# Define all the models in your project that you want indexed.

ItemIndex:
models:
Item:
fields:
id: unindexed
name:
boost: 1.5
type: text
description: text
tagList: text
photo: text
itemCategory: text
userCity: text
userSuburb: text
description: description
title: name

index:
encoding: UTF-8
cultures: [en]

ItemBackendIndex:
models:
Item:
fields:
id: unindexed
name:
boost: 1.5
type: text
description: text
tagList: text
photo: text
itemCategory: text
userCity: text
userSuburb: text
description: description
title: name

index:
encoding: UTF-8
cultures: [en]

myproject/apps/frontend/config/search.yml
# Define any application specific rules to your models here
# such as routing, partials, etc.

ItemIndex:
models:
Item:
route: item/take?item=%id%
partial: item/searchItem

myproject/apps/backend/config/search.yml
# Define any application specific rules to your models here
# such as routing, partials, etc.

ItemBackendIndex:
models:
Item:
route: item/take?item=%id%
partial: item/searchItem

Thanks!
Mikael
 Topic: SfGuard installation
SfGuard installation [message #68186] Fri, 19 December 2008 11:23
dave511  is currently offline dave511
Messages: 2
Registered: December 2008
Location: Marseille
Junior Member
Hi,

I installed sfGuardPlugin for my Symfony 1.2 project. It seemed that the installation is quiet good but there is no way to generate the SQL statements, the routes...

Did you ever get this problem?

Thanks
 Topic: [Doctrine] Bug in the search function?
[Doctrine] Bug in the search function? [message #68382] Mon, 22 December 2008 15:15
HiDDeN  is currently offline HiDDeN
Messages: 135
Registered: July 2006
Location: Barcelona, Spain
Senior Member
Look at the "listing 9" here: http://www.doctrine-project.org/documentation/manual/1_0/en/ searching#performing-searches

If you use the search function that way, you'll obtain this error:
[Doctrine_Table_Exception]
Unknown method Article::search


The model is well created with the corresponding columns declared as Searchable. But it gives that error when searching.
 Topic: Call to undefined method xfCriterionTerm::breakdown
Call to undefined method xfCriterionTerm::breakdown [message #68545] Wed, 24 December 2008 12:11
freakx0  is currently offline freakx0
Messages: 77
Registered: November 2006
Location: Germany
Member
Hi everybody,

i'm trying to use sfSearchPlugin+sfLucene+sfPropel with sf1.2.
After a few fixes i've build with the cli the index.
now i want to use the interface to search, the form is shown, but after submitting the form:
Fatal error: Call to undefined method xfCriterionTerm::breakdown() in ..\plugins\sfLucenePlugin\lib\criteria\xfLuceneCriterionRewr iter.class.php on line 27

so it doesn't work, i've no idea how to solve that problem.

 Topic: [SOLVED] sfLucenePlugin problem
[SOLVED] sfLucenePlugin problem [message #72832] Wed, 18 February 2009 15:25
ilyap  is currently offline ilyap
Messages: 3
Registered: July 2008
Location: Russia
Junior Member
Hi all,

I have installed sfLucenePlugin and now I'm following readme step-by-step. But when I execute symfony lucene-rebuild frontend I get the following error:

PHP Fatal error: Class 'Zend_Search_Lucene' not found in blablabla/htdocs/plugins/sfLucenePlugin/lib/sfLucene.class.p hp on line 444

Do I have to install anything else to make this plugin work?
I'm using symfony 1.0.

Thanks,
Ilya.

EDIT:
Copying Zend library files to lib directory solved the problem Smile

[Updated on: Sat, 21 February 2009 21:02]

 Topic: sfLucene -> search.yml -> Model : Is Unindexed the default field behaviour ???
sfLucene -> search.yml -> Model : Is Unindexed the default field behaviour ??? [message #73014] Fri, 20 February 2009 15:59
jb1234  is currently offline jb1234
Messages: 35
Registered: January 2008
Member
In the documentation, there is the following example :

MyIndex:
  models:
    BlogPost:
      fields:
        id: unindexed
        title:
          boost: 1.5
          type: text
        content: unstored
        description: text
    BlogComment:
      fields:
        id: unindexed
        summary: text
        message: text
      description: message
      title: summary


Should we list all the the fields of a module, even the one which are unindexed ? I have modules with a lot of fields and it is annoying to list each of them and write unindexed ? Or it is the default behaviour ?
 Topic: sfLucene : Undefined index raised in sfLucenePropelBehavior when saving index
sfLucene : Undefined index raised in sfLucenePropelBehavior when saving index [message #74137] Thu, 05 March 2009 17:10
jb1234  is currently offline jb1234
Messages: 35
Registered: January 2008
Member
Hi all,

Still a bit stuck with the SfLucene. I am testing the index updating when modifying a model and I get an error.

My model is called Article and when I save it I got the following error :

Notice: Undefined index: Article in /.../plugins/sfLucenePlugin/lib/behavior/sfLucenePropelBehavior.class.php on line 201


I suspect a bug with my configuration:

I got Mamp 1.7.2 (php 5.2.6) and SF 1.0.19. I have disabled Zend Optimizer, but still got this error message.



More details:


On this line you find
return $instances[$class];


and it this located in the following function.


 protected function getSearchInstances($node)
  {
    static $instances;

    $class = get_class($node);

    if (!isset($instances))
    {
      $instances = array();
    }

    if (!isset($instances[$class]))
    {
      $config = sfLucene::getConfig();

      foreach ($config as $name => $item)
      {
        if (isset($item['models'][$class]))
        {
          foreach ($item['index']['cultures'] as $culture)
          {
            $instances[$class][] = sfLucene::getInstance($name, $culture);
          }
        }
      }
    }

    return $instances[$class];
  }
 Topic: Is sfLucene for sf1.0 still developed or maintained ??
Is sfLucene for sf1.0 still developed or maintained ?? [message #75213] Thu, 19 March 2009 14:54
jb1234  is currently offline jb1234
Messages: 35
Registered: January 2008
Member
Hi All,

Searching for solutions about problem I face using sfLucene, I am wondering if this plugin is still 'alive', at least for version 1.0


For example I am getting sometimes an error when I use the save command in the backend, I get a chmod error (see attached picture).

This solution seems to have been fixed for 1.1 version.

I wanted to go to the plugin page to download version 1.1(to compare it), but it seems that you can download only version 1.0. This is adressed in this forum subject in the development/documentation :

http://forum.symfony-project.org/index.php/m/68915/?srch=sfl ucene#msg_68915

Also I noticed that the developer of this plugin, is not replying since about 6 months to the messages in the thread.

I just wanted to know if someone is following the development of this plugin or if I should look for another plugin for searching.

It is a great plugin, but it is not really easy to use.


Thanks


 Topic: limiting search results in sfSarchPlugin
limiting search results in sfSarchPlugin [message #77478] Tue, 28 April 2009 10:26
hautzi  is currently offline hautzi
Messages: 21
Registered: April 2006
Location: Heilbronn, Germany
Junior Member

Hello everyone,

I've encountered a small problem:

I'm currently using sfSearchPlugin (sfPropelSearchPlugin, sfLucenePlugin) with symfony 1.2. Everything works great, but I try to limit my Search results. One propel class has an "is_active" flag, and all of those objects with "is_active" set to false should not get into the index.

Most of the methods in sfSearchPlugin are declared as final, so I can't overwrite them.

I think this is a common problem, is there a out of the box solution? I didn't find any - not in the documentation, either.

Best regards
Christoph Hautzinger


http://diginights.com
 Topic: Zend Lucene and paginate
Zend Lucene and paginate [message #78025] Sat, 09 May 2009 00:16
ManuBu  is currently offline ManuBu
Messages: 2
Registered: May 2009
Junior Member
Hello,

I have a question:
I tried to insert a pagination like it is described on the following site:
http://symfonynerds.com/blog/?p=12

Now I want to insert the query from the Zend Lucene search. But I don't know how to insert it.
I tried to insert the query in the following code, but then there is a mistake, that array is no class.
$pager = new sfPropelPager('Company', 10);

So is there a way to replace the Country with the query?

Thanks a lot
 Topic: Which search plugin to use to implement site-wide search?
Which search plugin to use to implement site-wide search? [message #78617] Mon, 18 May 2009 14:17
sandydessert  is currently offline sandydessert
Messages: 61
Registered: August 2008
Location: India
Member
Requirement in brief:
I want to implement site-wide search functionality in our project and I have never used any symfony plugin so far. By site-wide search I mean whatever content is stored in the database tables should be searcheable.

About my system:
I have lots of modules in my site and all the different modules display a few paragraphs having a title and and a body. But all these are stored in several different tables.

An example to clarify my requirement:
Suppose if the user enters contact then the contact module of the site (which contains the address etc.) should appear along with other things.

Please give your ideas on which plugin would be best. As there will be many tables to be searched which one would be best performance-wise.



 Topic: Error in updating the details in zend lucene in symfony
Error in updating the details in zend lucene in symfony [message #79019] Wed, 27 May 2009 07:50
senthilkumar26  is currently offline senthilkumar26
Messages: 3
Registered: May 2009
Location: Bangalore
Junior Member
Hello,

I have implemented zend search lucene in symfony like the below code
$zendSearchLucenePath = $siteRootDir . sfConfig::get('app_search_user_index_file');
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());
if (!is_dir($zendSearchLucenePath)) {
	$index = new Zend_Search_Lucene($zendSearchLucenePath, true);
} else {
	$index = new Zend_Search_Lucene($zendSearchLucenePath);
}
		
// First find any reference to this user and delete them
$users = $index->find('user_id:'.$this->getId());
foreach($users as $user) {
	$index->delete($user->user_id);
}
// Create New Zend Search Lucene Document
$doc = $this->generateZSLDocument();
$index->addDocument($doc);
$index->commit;

public function generateZSLDocument() {		
      $doc = new Zend_Search_Lucene_Document();
      $doc->addField(Zend_Search_Lucene_Field::Keyword('user_id', $this->getId()));
      $doc->addField(Zend_Search_Lucene_Field::Keyword('username', $this->getUsername()));
      $doc->addField(Zend_Search_Lucene_Field::Keyword('email', $this->getEmail()));
      $doc->addField(Zend_Search_Lucene_Field::Text('firstname', $this->getFirstname()));
      $doc->addField(Zend_Search_Lucene_Field::Text('lastname', $this->getLastname()));
      $doc->addField(Zend_Search_Lucene_Field::Text('location', $this->getLocation()));
      $doc->addField(Zend_search_Lucene_Field::Unstored('contents', "{$this->getEmail()} {$this->getFirstname()} {$this->getLastname()} {$this->getUsername()} {$this->getLocation()}"));

      // return the document
      return $doc;
}


After inserting the first record, i am try to updating it but i am getting the error in this line
$index->delete($user->user_id);

This error is because in Lucene.php, there are checking like this
if ($id >= $this->_docCount) {
    require_once 'Zend/Search/Lucene/Exception.php';
    throw new Zend_Search_Lucene_Exception('Document id is out of the range.');
}


So, i above condition we can't able to delete the last record right?

After Updating the record, i am searching the word like the below code
$zendSearchLucenePath = $siteRootDir . sfConfig::get('app_search_user_index_file');
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());
$index = new Zend_Search_Lucene($zendSearchLucenePath);
	
$hits = $index->find(strtolower($query));
foreach($hits as $hit) {
    echo $hit->user_id.' -- '.$hit->username.' -- '.$hit->email.' -- '.$hit->firstname.' -- '.$hit->lastname.'<br />';
}


If i am updating the record for 3 times, while searching i am getting all 3 records like this

2 -- Kumar_260783 -- vel.kumar@gmail.com -- Kumar -- Vel
2 -- Kumar_2607 -- vel.kumar@gmail.com -- Kumar -- Vel
2 -- Kumar_26 -- vel.kumar@gmail.com -- Kumar -- Vel


Please can anyone help me, how to handle this type of errors.

Thanks & Regards,
Senthil R
 Topic: sflucene stop words ( array_flip(): Can only flip STRING and INTEGER values!)
sflucene stop words ( array_flip(): Can only flip STRING and INTEGER values!) [message #81896] Wed, 15 July 2009 12:56
iamdecal  is currently offline iamdecal
Messages: 23
Registered: January 2008
Junior Member
Just as a pointer if you get this error.


PHP Warning: array_flip(): Can only flip STRING and INTEGER values! in <YOURHOST> /plugins/sfLucenePlugin/lib/vendor/Zend/Search/Lucene/Analys is/TokenFilter/StopWords.php on line 55

the following stop words cause this.


off (Is replaced as blank)
on (Is replaced as 1)
no (Is replaced as blank)


i dont have yes as a stop word, but am pretty sure that it will be replaced as 1 inline with the changes abouve.

strickly speaking on and yes wont break the code - 1 is a valid integer after all, but no and off do.

please add anymore you come across below. hope this helps someone - took me a while to work out what was going on

FWIW my current list of english stopwords is.

stop_words:[a, about, above, across, after, afterwards, again, against, all, almost, alone, along, already, also, although, always, am, among, amongst, amoungst, amount, an, and, another, any, anyhow, anyone, anything, anyway, anywhere, are, around, as, at, back, be, became, because, become, becomes, becoming, been, before, beforehand, behind, being, below, beside, besides, between, beyond, bill, both, bottom, but, by, call, can, cannot, cant, co, computer, con, could, couldnt, cry, de, describe, detail, do, done, down, due, during, each, eg, eight, either, eleven, else, elsewhere, empty, enough, etc, even, ever, every, everyone, everything, everywhere, except, few, fifteen, fify, fill, find, fire, first, five, for, former, formerly, forty, found, four, from, front, full, further, get, give, go, had, has, hasnt, have, he, hence, her, here, hereafter, hereby, herein, hereupon, hers, herself, him, himself, his, how, however, hundred, i, ie, if, in, inc, indeed, interest, into, is, its, itself, keep, last, latter, latterly, least, less, ltd, made, many, may, me, meanwhile, might, mill, mine, more, moreover, most, mostly, move, much, must, my, myself, name, namely, neither, never, nevertheless, next, nine, nobody, none, noone, nor, not, nothing, now, nowhere, of, often, once, one, only, onto, or, other, others, otherwise, our, ours, ourselves, out, over, own, part, per, perhaps, please, put, rather, re, same, see, seem, seemed, seeming, seems, serious, several, she, should, show, side, since, sincere, six, sixty, so, some, somehow, someone, something, sometime, sometimes, somewhere, still, such, system, take, ten, than, that, the, their, them, themselves, then, thence, there, thereafter, thereby, therefore, therein, thereupon, these, they, thick, thin, third, this, those, though, three, through, throughout, thru, thus, to, together, too, top, toward, towards, twelve, twenty, two, un, under, until, up, upon, us, very, via, was, we, well, were, what, whatever, when, whence, whenever, where, whereafter, whereas, whereby, wherein, whereupon, wherever, whether, which, while, whither, who, whoever, whole, whom, whose, why, will, with, within, without, would, yet, you, your, yours, yourself, yourselves]

[Updated on: Wed, 15 July 2009 12:58]

 Topic: dont install sfShoppingCart in sf 1.2.8
dont install sfShoppingCart in sf 1.2.8 [message #82115] Sun, 19 July 2009 11:22
franzz82  is currently offline franzz82
Messages: 1
Registered: July 2009
Junior Member
Hi

I try install sfShoppingCart in sf 1.2.8

At prompt ms-dos:
symfony plugin:install sfShoppingCartPlugin


And Symfony respose:

No relase available for plugin sfShoppingCartPlugin


I need help to install this plugin or equivalent plugin in this relase sf [1.2.8]

Thank you
 Topic: [solved] The search engine work in frontend_dev.php but not in production
[solved] The search engine work in frontend_dev.php but not in production [message #82666] Mon, 27 July 2009 18:18
dalto1979  is currently offline dalto1979
Messages: 8
Registered: June 2009
Junior Member
My search engine works in developpement environnement and when i use my production url (without frontend_dev.php) the search engine return nothing ...

Any answers ?

Edit :

I sleep this night, and i build the index in my production, and of course it works Wink

[Updated on: Tue, 28 July 2009 10:04]

 Topic: Searching for more than 1 model with Zend Search
Searching for more than 1 model with Zend Search [message #84399] Wed, 26 August 2009 13:10
lukas22  is currently offline lukas22
Messages: 14
Registered: February 2009
Location: Paraná - Entre Ríos - A...
Junior Member

hey folks. I am study the better way to implement search engine in Symfony 1.2, but i'm little confused,
I do that in Symfony 1.0 with sfLucenePlugin with more than 2 models and all works fine. But now in Symfony 1.2, I do the same with Zend Search, like jobeet 17 day, but this solution only work's with 1 model Confused, so my question is,

What's is the better way to implemet a search engine in Symfony 1.2 with more than 1 model ??
Please need help for my work
Thanks in advance
 Topic: Zend Search Lucene: php timeout with small index
Zend Search Lucene: php timeout with small index [message #85486] Fri, 18 September 2009 02:56
Mindphreaker  is currently offline Mindphreaker
Messages: 151
Registered: December 2008
Location: Austria
Senior Member
Hello,

I have implemented a search with zend-lucene which works fine with normal queries - mostly. But as soon as I execute a search query which has more than 100 matches (e.g. searching for * or ?), the search becomes incredibly slow. It often leads me to get the 30sec php timeout while beeing in the $index->find() method of lucene.

While executing such a search, the server's cpu-load goes to 100% on at least one cpu. So this may also be a serious problem when thinking of DOS-attacks.

My code to insert to the index:

$doc = new Zend_Search_Lucene_Document();

// store content primary key to identify it in the search results
$doc->addField(Zend_Search_Lucene_Field::Keyword('pk', $this->getId()));
$doc->addField(Zend_Search_Lucene_Field::UnStored('ctitle', $this->getTitle(), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::UnStored('cdescription', $this->getDescription(), 'utf-8'));
    
$index = MipangaContentPeer::getLuceneIndex();
$index->addDocument($doc);
$index->commit();



My code to execute a search query:

$index = self::getLuceneIndex();
$index->setResultSetLimit( sfConfig::get('max_results_on_lucene') );
$hits = $index->find($query);


--> when more than about 200 matches exist, this function does not return within 30sec

When there are less than 20 matches, the find-method instantly returns.

I hope you can help me Smile


See my favourite websites!

Complexity is relative. Relativity is complex. - Anonymous
Anyone who can give you orders can stop you from solving whatever problem you're being fascinated by. - Eric. S. Raymond
 Topic: No result when searching unique data
No result when searching unique data [message #86704] Wed, 14 October 2009 16:28
jetgars  is currently offline jetgars
Messages: 20
Registered: May 2009
Junior Member
Hi! I'm using propel and symfony 1.2.

I declared my table in my schema.yml and items as follows:

Patient:
    id:             {type: integer, required: true, primaryKey: true, autoIncrement: true }
    admin_num:      {type: integer, index: unique}
    first_name:     {type: varchar(255)}
    mid_name:       {type: varchar(255)}
    last_name:      {type: varchar(255)}


Since i want my "admin_num" to be unique for each patients i set the index as unique.

Now want to index patient using their first name, last name and admin_num and declare it in this way:

$doc->addField(Zend_Search_Lucene_Field::UnStored('first_name', $this->getFirstName(), 'utf-8'));
       $doc->addField(Zend_Search_Lucene_Field::UnStored('last_name', $this->getLastName(), 'utf-8'));
	   $doc->addField(Zend_Search_Lucene_Field::UnStored('admin_num', $this->geAdminNum(), 'utf-8'));


My search function is working well and return the right results when i use their last name or first name as search parameter, but when i try to search using the admin_num, no results appear? How can i use the admin number searching?

Can anyone help me with this one?
Thank you!
 Topic: Searchable + Blog index
Searchable + Blog index [message #88915] Tue, 24 November 2009 02:42
passbe
Messages: 20
Registered: September 2008
Junior Member
I have a weird problem, i have three types of objects, Projects, Pages and Blogs. Now when i try and search for Projects or Pages under a certain keyword, i get results not a problem. But if i search for anything under Blogs i get the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in 
example.com/lib/symfony/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine.php on line 469 


This is the following code im using to test the search functionality:
$newsItemTable = Doctrine::getTable('Blog');
$results = $newsItemTable->search($this->form->getValue('keyword'));
print_r($results);


The database has the following:
blog_index: 127 rows
project_index: 147 rows
page_index: 0 (haven't inserted any records yet)

Is this a bug, or something i have done wrong? Any help would be appreciated.

Edit--
should have mentioned im using Doctrine and Symfony version 1.2.7

Edit 2--
have upgraded to symfony 1.4, still the same problem

[Updated on: Mon, 21 December 2009 11:11]

 Topic: sfSocialPlugin Problem in index.php
sfSocialPlugin Problem in index.php [message #90521] Mon, 28 December 2009 10:48
fruitlover  is currently offline fruitlover
Messages: 9
Registered: December 2009
Junior Member
Hi I'm newbie here.. I wonder why is it that after I Installed "sfsocialPlugin" and followed the "readme" instruction, when I visit http://localhost/sfproject/web/index.php in the browser, nothing displayed to that page. How can I view the User Interface of sfSocialPlugin (like in online working demo at http://social.garak.it/)? Shocked

Does anyone have a modification to do this, or is there a way to do this that I have not spotted?

Any ideas will be welcomed.
 Topic: How to display sfsocialPlugin?
How to display sfsocialPlugin? [message #91001] Thu, 07 January 2010 21:34
fruitlover  is currently offline fruitlover
Messages: 9
Registered: December 2009
Junior Member
hi i'm newbie here... i just want to ask why is it that the sfSocialPlugin could not be seen?

after i build the model and db, what step should i do in order to make that plugin visible to the frontend/templates/layout.php?

does anyone here knows how to makr the sfSocial plugin visible?
 Topic: sfSphinxPlugin Database Connection
sfSphinxPlugin Database Connection [message #92557] Sat, 30 January 2010 07:11
scott_dev  is currently offline scott_dev
Messages: 40
Registered: August 2008
Member
Hello Friends,
I would like to implement Sphinx.
Installed plugin from
http://www.symfony-project.org/plugins/sfSphinxPlugin

After installation path is
project_name/plugins/sfSphinxPlugin

I have installed Sphinx it's path is
project_name/sphinx-0.9.9, in that i have created sphinx.conf file & make DB connections.

Make modules & when i'm trying to search it's giving error
Sphinx connection to localhost:3312 failed (errno=111, msg=Connection refused)

at ()
in SF_ROOT_DIR/plugins/sfSphinxPlugin/lib/sfSphinxClient.class. php line 353 ...

350. {
351. $errstr = trim($errstr);
352. $this->error = "Sphinx connection to {$this->host}:{$this->port} failed (errno=$errno, msg=$errstr)";
353. throw new Exception($this->error);
354. }
355.
356. // check version


So where i have to put this config file. It's problem in DB connection

 Topic: Using MySQL Full-text Searching
Using MySQL Full-text Searching [message #99383] Wed, 19 May 2010 14:45
sorin21us  is currently offline sorin21us
Messages: 9
Registered: May 2010
Junior Member
When a user use the search, the result should be by relevance and date. I mean if the article is new, or keyword is in title or text.
I found this http://devzone.zend.com/article/1304 , but I don't know how to implement it to Lucene search.
Please someone help me.
 Topic: [SOLVED]Lucene Search implementation
[SOLVED]Lucene Search implementation [message #101660] Sat, 26 June 2010 23:32
ricardojguzman  is currently offline ricardojguzman
Messages: 26
Registered: March 2010
Junior Member
Hello

We are using sf 1.4 and doctrine.

I installed Lucene according to the Jobeet tutorial. And I've been getting into some problems with it.

When I do the search without any values I get the complete table that Lucene is working with.

But

When I do the search with values I get this error, in each field of the table;

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Doctrine_Collection' does not have a method 'getCedula' in /usr/share/php/symfony/escaper/sfOutputEscaperObjectDecorator.class.php on line 64


In each field it shows the field function like getNombres,getDate and such.

Thanks for your help.

Edit:

I solved this. It seems I had problems in my base class. After restarting the process again it is "working". But not showing any results.

[Updated on: Wed, 30 June 2010 02:26]

 Topic: lucene - range search - numerical values
lucene - range search - numerical values [message #102028] Mon, 05 July 2010 19:30
andys  is currently offline andys
Messages: 8
Registered: January 2010
Junior Member
Hi,

I have a really frustrating problem.

In Zend_Search_Lucene, I store price as keyword

I've tried to make range queries, but I've noticed that it returns items from outside of the range. For example:
3 items in index with prices: 0,500,600000

And now when I use this query: price:[4000 TO 6000], it return item with price of 500.
As far I've red it uses lexicographical comparison, so the price is in its range.

Any ideas how to solve this issue?
 Topic: I need a plugin to search
I need a plugin to search [message #102113] Wed, 07 July 2010 08:43
juanitourquiza  is currently offline juanitourquiza
Messages: 1
Registered: July 2010
Junior Member
I'm new in symfony and need a plugin to search in a database postgresql or mysql.
What is a recomendation?

Regards

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software