<br>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.<br>
<br><div class="gmail_quote">On Mon, Jul 7, 2008 at 4:00 PM, Jonathan <<a href="mailto:dev101@magma.ca">dev101@magma.ca</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
----- Original Message ----- From: "Tom Von Lahndorff" <<a href="mailto:tom@modscape.com" target="_blank">tom@modscape.com</a>><br>
To: "zope list user" <<a href="mailto:zope@zope.org" target="_blank">zope@zope.org</a>><br>
Sent: Monday, July 07, 2008 3:42 PM<br>
Subject: [Zope] ZCatalog : Searching Multiple Indexes : Returning One Result<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, I have a catalog called "catalog" that contains a bunch of cataloged<br>
items. I have indexed 3 properties for each item, "name", "body" and<br>
"description". I'd like to be able to search the catalog in the following<br>
way:<br>
<br>
if the word "text" shows up in any index, "name", "body" or "description",<br>
return that result back once.<br>
<br>
The problem is I have is that if a do a search for "text" and say there's<br>
results that have the word "text" in one or more of those indexes:<br>
<br>
catalog({name:query}) or catalog({body:query}) or<br>
catalog({description:query})<br>
only gives back limited results (leaves out some 'True' hits) and:<br>
catalog({name:query}) + catalog({body:query}) + catalog({description:query})<br>
gives me back the same result 3 times.<br>
<br>
any ideas? Thanks.<br>
</blockquote>
<br></div></div>
Something I saved from a long time ago post (warning untested) which may give you some ideas:<br>
<br>
<snip><br>
context.Catalog({'keywordindex': ['Value1', 'Value2']})<br>
Catalog returns me an OR search instead of an AND one<br>
<br>
Use "context.Catalog(keywordindex = {'query':[...], operator='and'})"<br>
when you want to use the "and" operator.<br>
</snip><br>
<br>
hth<br><font color="#888888">
<br>
Jonathan<br>
<br>
</font></blockquote></div><br>