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.
Home » plugins » Search plugins » sfLucene and NO culture
sfLucene and NO culture [message #85511] Fri, 18 September 2009 16:14 Go to next message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
Seems like configuring sfLucene for norwegian culture is a pain in the... you know Wink

I have managed to generate the search index. But when trying to do a search, the application fail with an error message saying:
[sfLuceneException]
Culture "no" is not enabled.


And the documentation say:
(If you receive an exception saying "Culture XXX is not enabled" then define the culture even if you do not use i18n.)


just wonder... how do I define a culture? The symfony documentation say nothing about how to do it (AFAIK).


May the source be with you
Re: sfLucene and NO culture [message #85818 is a reply to message #85511 ] Mon, 28 September 2009 09:14 Go to previous messageGo to next message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
No one that can help me with this? Sad


May the source be with you
Re: sfLucene and NO culture [message #85904 is a reply to message #85818 ] Tue, 29 September 2009 13:36 Go to previous messageGo to next message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
Seems like noone has tried to get the sfLucene plugin to work in a norwegian language culture... Sad

I have used several hours trying to find out how to make it work with language set to NO (for Norwegian) without luck...

So I guess that sfLucene does *NOT* work with NO culture...?


May the source be with you
Re: sfLucene and NO culture [message #86303 is a reply to message #85904 ] Wed, 07 October 2009 10:17 Go to previous messageGo to next message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
Final call for help!.

I'm still trying to get sfLucene to work when culture is set to NO.

the application config/search.yml file looks like this:
[CODE]
AppIndex:
models:
<model description removed>

index:
encoding: UTF-8
cultures: NO
[CODE]

Then I added some debug code to the file plugins/sfLucenePlugin/lib/sfLucene.class.php:
protected function loadConfig()
{
  $config = self::getConfig();
  if (!isset($config[$this->name])) {
    return false;
  }
  echo '<pre>'; var_dump($config); die;


When the cultures is set to NO, the dump of $config shows that the culturs array is false:
  ["index"]=>
  array(8) {
    ["encoding"]=>
    string(5) "utf-8"
    ["cultures"]=>
    bool(false)


If I change the culture in the search.yml file to "EN, FR" (just an example), the cultures array in $config is set to "EN, FR".
  ["index"]=>
  array(8) {
    ["encoding"]=>
    string(5) "utf-8"
    ["cultures"]=>
    string(6) "EN, FR"


Can someone please explain why?


May the source be with you
Re: sfLucene and NO culture [message #86304 is a reply to message #86303 ] Wed, 07 October 2009 10:21 Go to previous messageGo to next message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
Hehe... I know why. The culture string NO is parsed as no (in opposite to yes)...

Single- or double-quoting the word does not help. It is stilled parsed as no.

So it seems like the yml parser is messing things up, or?


May the source be with you
Re: sfLucene and NO culture [message #86897 is a reply to message #85511 ] Sun, 18 October 2009 11:45 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Hi skywalker. I would have thought there would be a way to escape the 'no' value - not sure how though! Perhaps try switching to a different YAML parser? If you are stuck on this, however, try dropping a line to the sfLucene maintainer. When I did so (about a year ago) they were very helpful indeed in tracking down a rare bug.


Remember Palestine
Re: sfLucene and NO culture [message #86940 is a reply to message #86897 ] Mon, 19 October 2009 09:48 Go to previous message
skywalker  is currently offline skywalker
Messages: 334
Registered: March 2008
Location: Norway
Faithful Member
Thanks for your reply. I had to do some trick in the myUser class too. After spending several hours on this issue I got it working - at last.

And yes. 'no' has to be quoted.


May the source be with you
Previous Topic:Can't build index
Next Topic:problem about lucene
Goto Forum:
  

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