Length of Search Results/ZServer Crawling
Zopsters, Does anyone know why this code: <!--#in "Catalog(meta_type=['MyClass'])"--> <!--#var "_.len(Catalog.searchResults())"--> <!--#/in--> Outside the Catalog, renders the number of all the objects in the Catalog and not the Amount of MyClasse instances in the Catalog? I'd like to get the number of objects of a give type with some property values that are cataloged, but I'm unable to. Also, ZServer has been slowing to a crawl and taking 2-3 minutes to give back responses at times. Very vague, I know, but I don't see activity on all of the threads, so I don't see how more threads would solve the problem. Right now I am running what looks like the default 6 threads. All with 13% of CPU percentage. I've got about 20 people hammering this thing non-stop all day long. The spead is good when I restart Zope, but then it deteriorates the longer the process is leftr running. -- Jason Spisak webmaster@hiretechs.com
At 22:24 20/09/99 , Jason Spisak wrote:
Zopsters,
Does anyone know why this code:
<!--#in "Catalog(meta_type=['MyClass'])"--> <!--#var "_.len(Catalog.searchResults())"--> <!--#/in-->
Outside the Catalog, renders the number of all the objects in the Catalog and not the Amount of MyClasse instances in the Catalog? I'd like to get the number of objects of a give type with some property values that are cataloged, but I'm unable to.
That's because Catalog() is the same as Catalog.searchResults(). So you could rewrite your code to: <dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var "_.len(Catalog())"> </dtml-in> and then you'll see what you're doing wrong =). Better use this: <dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var "_.len(Catalog(meta_type=['MyClass']))"> </dtml-in> or you could use one of the count- variables to determine the number of objects: <dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var count-meta_type> </dtml-in> -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Martijn , Thanks for the clarification. I didn't know about the count variables. Very useful stuff! I had thought that the 'in' tag was kind of like the 'with' tag in regard to search results. Learning though. Thanks again, Jason
At 22:24 20/09/99 , Jason Spisak wrote:
Zopsters,
Does anyone know why this code:
<!--#in "Catalog(meta_type=['MyClass'])"--> <!--#var "_.len(Catalog.searchResults())"--> <!--#/in-->
Outside the Catalog, renders the number of all the objects in the Catalog and not the Amount of MyClasse instances in the Catalog? I'd like to get the number of objects of a give type with some property values that are cataloged, but I'm unable to.
That's because Catalog() is the same as Catalog.searchResults(). So you could rewrite your code to:
<dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var "_.len(Catalog())"> </dtml-in>
and then you'll see what you're doing wrong =). Better use this:
<dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var "_.len(Catalog(meta_type=['MyClass']))"> </dtml-in>
or you could use one of the count- variables to determine the number of objects:
<dtml-in "Catalog(meta_type=['MyClass'])"> <dtml-var count-meta_type> </dtml-in>
-- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Jason Spisak webmaster@hiretechs.com
participants (3)
-
Jason Spisak -
Jason Spisak -
Martijn Pieters