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 » [solved] sfLucene no search results
[solved] sfLucene no search results [message #66961] Sat, 06 December 2008 01:22 Go to next message
rfrobel  is currently offline rfrobel
Messages: 10
Registered: November 2007
Location: Switzerland
Junior Member
Hi all,

I installed sfLucenePlugin 0.1.6 on symfony 1.0.11. I use the basic search interface but I get no searchresult at all (field: title)

part of schema.yml:

  bf_message:
    _attributes:      { phpName: Message }
    id:
    guarduser_id:     { type: integer, foreignTable: sf_guard_user, foreignReference: id }
    typ:              varchar(50)
    must:             { type: boolean, default: 0 }
    title:            varchar(255)
    smile:            varchar(255)
    messagetext:      longvarchar
    notify_onreply:   { type: boolean, default: 0 }
    valid_from:       { type: date }
    valid_to:         { type: date }
    created_at:


app.yml:

all:
  lucene:
    index:               BfIndex
    advanced: on
    per_page: 10


project level search.yml:

BfIndex:
  models:
    Message:
      id:
      title:
        boost:      1.5
        type:       text
      messagetext:
        type:       text
        transform:  strip_tags

  index:
    encoding: UTF-8
    analyzer: utf8
    clutures: [de_CH]
    case_sensitive: off


myapp level search.yml

BfIndex:
  models:
    Message:
      route:      news/show?id=%id%


building index succeeds:

C:\Programme\PHP\butterfly>symfony lucene-rebuild f
Processing "BfIndex/de_CH" now...
>> lucene    Created new index
>> lucene    Rebuilding...
>> indexer   Inserted model "Message" with PK = 13
>> indexer   Inserted model "Message" with PK = 14
>> indexer   Inserted model "Message" with PK = 15
>> indexer   Inserted model "Message" with PK = 16
>> lucene    Optimizing...
>> lucene    Committing...
Done! Indexed 4 documents in 0.837139 seconds.

All done! Rebuilt for 1 index in 2.434256 seconds.


when I type for instance:

testmessage

(this message title exists), I get "no results found". Any hints? thank you.

[Updated on: Mon, 30 March 2009 00:11]

Re: sfLucene no search results [message #66984 is a reply to message #66961 ] Sat, 06 December 2008 13:56 Go to previous messageGo to next message
wissl  is currently offline wissl
Messages: 447
Registered: March 2008
Location: Germany
Faithful Member
When working with lucene it is always a good idea to use "Luke", a java application that provides "looking into the index". I suggest running it, open your index file, and you will see if the entries sfLucene should have indexed for you really exist in the index.

http://www.getopt.org/luke/
Re: sfLucene no search results [message #67051 is a reply to message #66984 ] Mon, 08 December 2008 01:07 Go to previous messageGo to next message
rfrobel  is currently offline rfrobel
Messages: 10
Registered: November 2007
Location: Switzerland
Junior Member
thanks for reply

"looking into the index" tells me that the values are not correct
1	sfl_guid	de_CH-022535fea7a6b639085347f724b67d80b03a1a389d8b9b0ea320dfad32f896246b58d045

The .yml file-entries have no effect on the index values. Except the model name (Message) in app-level search-yml.
Re: sfLucene no search results [message #67065 is a reply to message #66961 ] Mon, 08 December 2008 09:16 Go to previous messageGo to next message
wissl  is currently offline wissl
Messages: 447
Registered: March 2008
Location: Germany
Faithful Member
What do you mean by "values are not correct". Are the objects indexed but with wrong values, or aren't they added at all?


You added the sfLucene behavior to your model, yes?

sfLucenePropelBehavior::getInitializer()->setupModel('Model');


and in propel.ini:
propel.builder.addBehaviors = true
Re: sfLucene no search results [message #67090 is a reply to message #67065 ] Mon, 08 December 2008 13:53 Go to previous messageGo to next message
rfrobel  is currently offline rfrobel
Messages: 10
Registered: November 2007
Location: Switzerland
Junior Member
yes I added the sfLucene behavior to the model. I set the ...behaviors = true in propel.ini and I rebuilt the model.

the objects are added but with wrong values (wrong fieldname and values)

when i look into the index I have for instance for document-no. 1:

field: <sfl_guid> value: de_CH-22535fea7a6b639085...
field: <sfl_model> value: Message
field: <sfl_type> value: Model

In my opinion there should be something like this:

field: <id> value: primary key
field: <title> value: "testmessage"
field: <messagetext> value: "blablabla"

...fieldnames according to the entries in my project level search.yml. maybe I'm completely wrong Sad








Re: sfLucene no search results [message #75826 is a reply to message #67090 ] Mon, 30 March 2009 00:10 Go to previous message
rfrobel  is currently offline rfrobel
Messages: 10
Registered: November 2007
Location: Switzerland
Junior Member
didn't configure the project's search.yml file properly

wrong:
BfIndex:
  models:
    Message:
      id:
      title:
        boost:      1.5
        type:       text


right:
BfIndex:
  models:
    Message:
      fields:
        id:           unindexed
        title:
          boost:      1.5
          type:       text


and the fields are added to the index... Embarassed
Previous Topic:Is sfLucene for sf1.0 still developed or maintained ??
Next Topic:[Zend Lucene] Updating indexes
Goto Forum:
  

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