Search multiple indexes at once using Lucene search

I use Zend_Search_Lucene to implement a site search. I created separate indexes for different data types (for example, one for users, one for messages, etc.). Results are similarly divided by data type, but there is an “all” option that should show a combination of different types of results. Can I search for different indexes at the same time? or do i need to index everything in the whole index?

Update: readme for ZF 1.8 suggests that it is now possible to do this in ZF 1.8, but I could not track where this is indicated in the documentation.

+3
source share
3 answers

, Zend_Search_Lucene_Interface_MultiSearcher. , ZF 1.8, t

$index = new Zend_Search_Lucene_Interface_MultiSearcher();
$index->addIndex(Zend_Search_Lucene::open('search/index1'));
$index->addIndex(Zend_Search_Lucene::open('search/index2'));
$index->find('someSearchQuery');

NB PEAR, Zend_Loader:: loadClass

+7

huddler.com. Zend_Search_Lucene, . "all" , , , , , "" ". Zend Lucene Lucene, , . , Zend lucene, - (10-100 ), , , " a *", ( ).

, , Zend Lucene . 1,0 , 15 . . 20 .

Solr; Solr 50 , 1000 ( & 5 , < 100ms), . , 100 000 + 30 ( 20 ).

Solr "type"; , "type:" "type:" "all".

100+ , - , Zend_Search_Lucene.

+3

I don’t understand how it integrates with Zend, but in Lucene you can use MultiSearcher instead of the usual IndexSearcher.

+2
source

Source: https://habr.com/ru/post/1705711/


All Articles