ZCatalog : Searching Multiple Indexes : Returning One Result
Hi, I have a catalog called "catalog" that contains a bunch of cataloged items. I have indexed 3 properties for each item, "name", "body" and "description". I'd like to be able to search the catalog in the following way: if the word "text" shows up in any index, "name", "body" or "description", return that result back once. The problem is I have is that if a do a search for "text" and say there's results that have the word "text" in one or more of those indexes: catalog({name:query}) or catalog({body:query}) or catalog({description:query}) only gives back limited results (leaves out some 'True' hits) and: catalog({name:query}) + catalog({body:query}) + catalog({description:query}) gives me back the same result 3 times. any ideas? Thanks.
----- Original Message ----- From: "Tom Von Lahndorff" <tom@modscape.com> To: "zope list user" <zope@zope.org> Sent: Monday, July 07, 2008 3:42 PM Subject: [Zope] ZCatalog : Searching Multiple Indexes : Returning One Result
Hi, I have a catalog called "catalog" that contains a bunch of cataloged items. I have indexed 3 properties for each item, "name", "body" and "description". I'd like to be able to search the catalog in the following way:
if the word "text" shows up in any index, "name", "body" or "description", return that result back once.
The problem is I have is that if a do a search for "text" and say there's results that have the word "text" in one or more of those indexes:
catalog({name:query}) or catalog({body:query}) or catalog({description:query}) only gives back limited results (leaves out some 'True' hits) and: catalog({name:query}) + catalog({body:query}) + catalog({description:query}) gives me back the same result 3 times.
any ideas? Thanks.
Something I saved from a long time ago post (warning untested) which may give you some ideas: <snip> context.Catalog({'keywordindex': ['Value1', 'Value2']}) Catalog returns me an OR search instead of an AND one Use "context.Catalog(keywordindex = {'query':[...], operator='and'})" when you want to use the "and" operator. </snip> hth Jonathan
If I understand correctly, this seems like searching for multiple values in one index. What I'm looking to do is search for one value in multiple indexes... and get back one result even if there are True hits in more than one index. On Mon, Jul 7, 2008 at 4:00 PM, Jonathan <dev101@magma.ca> wrote:
----- Original Message ----- From: "Tom Von Lahndorff" <tom@modscape.com> To: "zope list user" <zope@zope.org> Sent: Monday, July 07, 2008 3:42 PM Subject: [Zope] ZCatalog : Searching Multiple Indexes : Returning One Result
Hi, I have a catalog called "catalog" that contains a bunch of cataloged
items. I have indexed 3 properties for each item, "name", "body" and "description". I'd like to be able to search the catalog in the following way:
if the word "text" shows up in any index, "name", "body" or "description", return that result back once.
The problem is I have is that if a do a search for "text" and say there's results that have the word "text" in one or more of those indexes:
catalog({name:query}) or catalog({body:query}) or catalog({description:query}) only gives back limited results (leaves out some 'True' hits) and: catalog({name:query}) + catalog({body:query}) + catalog({description:query}) gives me back the same result 3 times.
any ideas? Thanks.
Something I saved from a long time ago post (warning untested) which may give you some ideas:
<snip> context.Catalog({'keywordindex': ['Value1', 'Value2']}) Catalog returns me an OR search instead of an AND one
Use "context.Catalog(keywordindex = {'query':[...], operator='and'})" when you want to use the "and" operator. </snip>
hth
Jonathan
I know, I know...too old to worry about... Zope 2.8.9.1 on RedHat and MySQL5 In the Test tab of a ZSQL method, where the query has parameters, when we enter parameters that generate a result of more than 20 rows, we get the link for next 20 results. However, the parameters are not getting passed in and the next page shows all the rows as if no parameters passed. Anyone else seen this? Thanks Allen
On Thursday 10 July 2008 20:47, Allen Schmidt Sr. wrote:
I know, I know...too old to worry about... Zope 2.8.9.1 on RedHat and MySQL5
In the Test tab of a ZSQL method, where the query has parameters, when we enter parameters that generate a result of more than 20 rows, we get the link for next 20 results. However, the parameters are not getting passed in and the next page shows all the rows as if no parameters passed.
Anyone else seen this? Yes Zope 2.9 gives error for the missing parameters on second page. I have just lived with it having seen the error before on this list. regards garry
I've seen this before in ZSQL test . But sometimes I have found that forms I've created that do this with POST work by changing the method to GET or viceversa Thomas On Thursday 10 July 2008 16:37, Garry Saddington wrote:
On Thursday 10 July 2008 20:47, Allen Schmidt Sr. wrote:
I know, I know...too old to worry about... Zope 2.8.9.1 on RedHat and MySQL5
In the Test tab of a ZSQL method, where the query has parameters, when we enter parameters that generate a result of more than 20 rows, we get the link for next 20 results. However, the parameters are not getting passed in and the next page shows all the rows as if no parameters passed.
Anyone else seen this?
Yes Zope 2.9 gives error for the missing parameters on second page. I have just lived with it having seen the error before on this list. regards garry _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- ==================================================================== Thomas McMillan Grant Bennett Appalachian State University Operations & Systems Analyst P O Box 32026 University Library Boone, North Carolina 28608 (828) 262 6587 "... using OpenOffice.org, and save them back to disk automatically, in MS Word format. They surf the Web, check e-mail, do instant messaging, view YouTube videos, visit their Facebook pages, learn touch-typing skills and lots more. Our public library has been offering these Linux public stations for the past three years." - Phil Shapiro Linux Journal January 2008 Library Systems Help Desk: https://www.library.appstate.edu/help/ ====================================================================
Hi all, many years I use patched files - here are (see attachment) from my Zope 251 at ZOPEROOT/lib/python/Shared/DC/ZRDB/dtml But it is not able to handle tooooo loooong queries, for long queries it needs one more little mod with FORM tag. So see the little nuances with your newer zope sources ;-) Regards, JL. ----- Original Message ----- From: "Garry Saddington" <garry@schoolteachers.co.uk>
On Thursday 10 July 2008 20:47, Allen Schmidt Sr. wrote:
I know, I know...too old to worry about... Zope 2.8.9.1 on RedHat and MySQL5
In the Test tab of a ZSQL method, where the query has parameters, when we enter parameters that generate a result of more than 20 rows, we get the link for next 20 results. However, the parameters are not getting passed in and the next page shows all the rows as if no parameters passed.
Anyone else seen this? Yes Zope 2.9 gives error for the missing parameters on second page. I have just lived with it having seen the error before on this list.
participants (6)
-
Allen Schmidt Sr. -
Garry Saddington -
Jaroslav Lukesh -
Jonathan -
Thomas Bennett -
Tom Von Lahndorff