Is there any way to seach a catalog for either column1 = 'something' OR column2 = 'something' ? searchResults(column1='something', column2='something') Only returns results when 'something' is in both column1 AND column2 I could combine 2 results but then they won't be weighted correctly... Have I got any other options?
res = searchResults(query1...) + searchResults(query2...) --On Dienstag, 11. Februar 2003 12:45 +1300 Chris Beaven <chris@d-designz.co.nz> wrote:
Is there any way to seach a catalog for either column1 = 'something' OR column2 = 'something' ?
searchResults(column1='something', column2='something') Only returns results when 'something' is in both column1 AND column2
I could combine 2 results but then they won't be weighted correctly...
Have I got any other options?
_______________________________________________ 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 )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
The problem I have is that the results should be weighted. If I'm using ZCTextIndexes the weighting of a search result works really well. If I simply concatenate the results, won't the weighting be stuffed? Andreas Jung wrote:
res = searchResults(query1...) + searchResults(query2...)
--On Dienstag, 11. Februar 2003 12:45 +1300 Chris Beaven <chris@d-designz.co.nz> wrote:
Is there any way to seach a catalog for either column1 = 'something'
OR
column2 = 'something' ?
searchResults(column1='something', column2='something') Only returns results when 'something' is in both column1 AND column2
I could combine 2 results but then they won't be weighted correctly...
Have I got any other options?
_______________________________________________ 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 )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" -
---------------------------------------------------------------------
Chris Beaven wrote:
The problem I have is that the results should be weighted. If I'm using ZCTextIndexes the weighting of a search result works really well. If I simply concatenate the results, won't the weighting be stuffed?
Why can't you use something like Catalog.searchResults(PrincipiaSearchSource='word1 or word2')? -mj
Because it's 2 different indexes I'm searching Maik Jablonski wrote:
Chris Beaven wrote:
The problem I have is that the results should be weighted. If I'm
using
ZCTextIndexes the weighting of a search result works really well. If I
simply concatenate the results, won't the weighting be stuffed?
Why can't you use something like
Catalog.searchResults(PrincipiaSearchSource='word1 or word2')?
-mj
_______________________________________________ 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 )
Chris Beaven wrote:
Because it's 2 different indexes I'm searching
Then I would set up a combined index, which should do the weighting... Create a PythonScript (id=CatIndex) which concates the two indexes (the properties) and returns the result. Then index the CatIndex in your Catalog and query it with 'a or b'. ZCTextIndex will give you the weighted result... -mj
Thanks Maik, that's exactly what I wanted to do! Score another one to the vigilent zope zenners ;) Maik Jablonski wrote:
Chris Beaven wrote:
Because it's 2 different indexes I'm searching
Then I would set up a combined index, which should do the weighting... Create a PythonScript (id=CatIndex) which concates the two indexes (the properties) and returns the result. Then index the CatIndex in your Catalog and query it with 'a or b'. ZCTextIndex will give you the weighted result...
-mj
_______________________________________________ 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 )
participants (4)
-
Andreas Jung -
Chris Beaven -
Dieter Maurer -
Maik Jablonski