[Zope] Re: [Fwd: [Zope] Re: Advanced search in ZCatalog (Micha)]

2000-11-14 Thread daniel dias


Hi,

Ok, I could achieve something with this approach. But
it's not clear for me how to set the ZCatalog to
create an index from the result of an external method.
Can you please explain how to achieve this?

Also, the ZCatalog queries use an "and" chain for each
token provided (eg. if a query is requested for "a b
c" it will be interpreted as "a" and "b" and "c"), and
I'd like to implement an "or" chain in the queries.

Thanks for the help,

Daniel

--- Maik Röder [EMAIL PROTECTED] wrote:  
Hi Daniel !
 
 daniel dias wrote:
  
  you've a copy of this python method to send me?
  thanks maik!
 
 Look at what Michael Kobald wrote:
 
 Regards,
 
 Maik 
 
 michael Kobald wrote:
  
  Hi,
  I played with ZCatalog and ZClasses a time ago.
  Due to the fact that ZCatalog can Index all
 Objects - You Can Index a
  Method, .!!!
  This Methods can be External-, Phython-, or
 DTML-Methods.
  But they have to return something to the catalog
 (DTML-RETURN Tag).
  You can give this method a name like
 "PrincipiaSearchSource" or what the
  hell you think of.
  
  In my case I index about 10 different ZClass, 100
 Instances of them, with a
  PythonMethod called text_inhalt (text_contents)
  Param: self
  Code
  return string.join((self.id, self.inhalt), '; ')
  
  Or in an  subclass
  return string.join((self.id, self.teaser,
 self.gericht, self.keys, self.art,
  self.norm, self.parteien), '; ')
  
  Be warned you can use a DTML Method and return
 something with the
  dtml-return tag, but this is not working very well
 within a ZCLass, !!!
  ??
  
  P.S.:
  If you want to call a resultObject (e.g. a ZClass)
 directly through
  Zope/DTML/Python use the PyMethod "fetchObj" much
 cooler than only via
  catalog.getpath (which is link /hfg/kkjk/)
  
  to do somthing like this:
  
  dtml-in mein Result from a canned search
  
  dtml-call
 

"REQUEST.set('meineURL',fetchObj(_,Catalog.getpath(_.int(_['sequence-item'])
  )))"convert /parent/child to an real object
 parent.child
  
  dtml-var meineURL  *** points to a ZClass
 [Base:Renderable] calling the
  Object/Class directly, which renders itself
  
  /dtml-in
  
  use something like this:
  
  Python Method: fetchObj
  
  Param: _,fetchStr, attr=None
  
  obj = _
  for p in string.split(fetchStr, '/'):
 obj = obj[p]
  if attr is None:
 return obj
  else:
 return render(_.getattr(obj, attr))
  
  Greetings from Heidelberg
  
  Michael Kobald
  
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
  
 http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )




Do You Yahoo!?
Crie o seu e-mail grátis do Yahoo! Mail com 6 Megabytes livres!
http://mail.yahoo.com.br

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: [Fwd: [Zope] Re: Advanced search in ZCatalog (Micha)]

2000-11-14 Thread daniel dias


Hi,

Ok, I could achieve something with this approach. But
it's not clear for me how to set the ZCatalog to
create an index from the result of an external method.
Can you please explain how to achieve this?

Also, the ZCatalog queries use an "and" chain for each
token provided (eg. if a query is requested for "a b
c" it will be interpreted as "a" and "b" and "c"), and
I'd like to implement an "or" chain in the queries.

Thanks for the help,

Daniel

--- Maik Röder [EMAIL PROTECTED] wrote:  
Hi Daniel !
 
 daniel dias wrote:
  
  you've a copy of this python method to send me?
  thanks maik!
 
 Look at what Michael Kobald wrote:
 
 Regards,
 
 Maik 
 
 michael Kobald wrote:
  
  Hi,
  I played with ZCatalog and ZClasses a time ago.
  Due to the fact that ZCatalog can Index all
 Objects - You Can Index a
  Method, .!!!
  This Methods can be External-, Phython-, or
 DTML-Methods.
  But they have to return something to the catalog
 (DTML-RETURN Tag).
  You can give this method a name like
 "PrincipiaSearchSource" or what the
  hell you think of.
  
  In my case I index about 10 different ZClass, 100
 Instances of them, with a
  PythonMethod called text_inhalt (text_contents)
  Param: self
  Code
  return string.join((self.id, self.inhalt), '; ')
  
  Or in an  subclass
  return string.join((self.id, self.teaser,
 self.gericht, self.keys, self.art,
  self.norm, self.parteien), '; ')
  
  Be warned you can use a DTML Method and return
 something with the
  dtml-return tag, but this is not working very well
 within a ZCLass, !!!
  ??
  
  P.S.:
  If you want to call a resultObject (e.g. a ZClass)
 directly through
  Zope/DTML/Python use the PyMethod "fetchObj" much
 cooler than only via
  catalog.getpath (which is link /hfg/kkjk/)
  
  to do somthing like this:
  
  dtml-in mein Result from a canned search
  
  dtml-call
 

"REQUEST.set('meineURL',fetchObj(_,Catalog.getpath(_.int(_['sequence-item'])
  )))"convert /parent/child to an real object
 parent.child
  
  dtml-var meineURL  *** points to a ZClass
 [Base:Renderable] calling the
  Object/Class directly, which renders itself
  
  /dtml-in
  
  use something like this:
  
  Python Method: fetchObj
  
  Param: _,fetchStr, attr=None
  
  obj = _
  for p in string.split(fetchStr, '/'):
 obj = obj[p]
  if attr is None:
 return obj
  else:
 return render(_.getattr(obj, attr))
  
  Greetings from Heidelberg
  
  Michael Kobald
  
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
  
 http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )




Do You Yahoo!?
Crie o seu e-mail grátis do Yahoo! Mail com 6 Megabytes livres!
http://mail.yahoo.com.br

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Advanced search in Zcatalog...

2000-11-13 Thread daniel dias

Hi!
I´m trying to discover how to make a ZCatalog perform
queries on several "fields" (as in the property
sheets) of the cataloged objects, but with no sucess.
I´d like to execute queries using a "or" chain of
tokens, to be applied on several fields of the
cataloged objects, given that each field has a
priority in the search results.

Any ideas on how to implement this? I´ve tried several
approaches with absolutely no sucess, and I´m pretty
stuck, so any help will be welcome.

Thanks,

Daniel Dias


Do You Yahoo!?
Crie o seu e-mail grátis do Yahoo! Mail com 6 Megabytes livres!
http://mail.yahoo.com.br

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Advanced search in ZCatalog

2000-11-13 Thread daniel dias

Hi!
I´m trying to discover how to make a ZCatalog perform
queries on several "fields" (as in the property
sheets) of the cataloged objects, but with no sucess.
I´d like to execute queries using a "or" chain of
tokens, to be applied on several fields of the
cataloged objects, given that each field has a
priority in the search results.

Any ideas on how to implement this? I´ve tried several
approaches with absolutely no sucess, and I´m pretty
stuck, so any help will be welcome.

Thanks,

Daniel Dias



Do You Yahoo!?
Crie o seu e-mail grátis do Yahoo! Mail com 6 Megabytes livres!
http://mail.yahoo.com.br

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )