Discussion:
One index or multiple indexes?
Jack Sleight
2008-06-05 18:40:18 UTC
Permalink
Hi,
I have an application with multiple modules, each of which contain very
different kinds of data (eg. news and shop), and each would have their
results displayed in different ways (although on one page, I want people
to be able to search everything from one place). Is it best to maintain
separate indexes for each module, then query them all when someone does
a search, or is it best to store everything in one index, and then
(somehow??) group the results into their relevant modules and display
them that way?

Thanks for any advice,
--
Jack
Matthew Weier O'Phinney
2008-06-08 12:06:57 UTC
Permalink
Post by Jack Sleight
I have an application with multiple modules, each of which contain very
different kinds of data (eg. news and shop), and each would have their
results displayed in different ways (although on one page, I want people
to be able to search everything from one place). Is it best to maintain
separate indexes for each module, then query them all when someone does
a search, or is it best to store everything in one index, and then
(somehow??) group the results into their relevant modules and display
them that way?
I've done both approaches, actually. On the ZF site, we have multiple
indices -- primarily because we build one for the manual, and then
re-use the ones built by the various developer tools (wiki, issue
tracker, etc); site search then queries each individually and presents
segregated results.

I've also done search where all data is in the same index. To make this
work well, it's good to use a keyword that has unique values for each
"application". As an example, if you have a 'bug' application, you might
have a keyword 'model' that has values of 'issue' and 'comment' --
allowing you to search on _just_ issues or _just_ comments by adding a
'model:issue' or 'model:comment' phrase to the search query.
--
Matthew Weier O'Phinney
Software Architect | matthew-C1q0ot2/***@public.gmane.org
Zend Framework | http://framework.zend.com/
Continue reading on narkive:
Loading...