Hi,
I have a problem in searching multiple indexes.
We have two options to do this
*1- using MuliSearcher*
with this option i always get hits from the second index only however i use
MultiSearcher::subSearcher(int32_tn) to be sure that the hit is from
the index number (0)
here is a code sample
Searchable*s[3]={newIndexSearcher(firstIndexPath),newIndexSearcher(secondIndexPath()),NULL};
MultiSearcher * searcher = new MultiSearcher(s);
Hits * hits = searcher->search(query);
for(int i = 0; i < hits->length(); i++){
cout<<searcher->subSearcher(i);
}
The Result is
0
0
1
1
So it means that i have hits from each index, but when i try to get the
docs i always found that the docs came from the second index!
*2- Using MultiReader*
with this option i couldn't make the app to compile.
here is a code sample
lucene::util::Array<IndexReader*>*r=newlucene::util::Array<IndexReader*>(3);
r[0] = IndexReader::open(firstIndexPath);
r[1] = IndexReader::open(secondIndexPath);
r[2] = NULL;
MultiReader * multiReader = new MultiReader(r);
m_searcher=newIndexSearcher(multiReader);
I always get an error
error: invalid conversion from 'lucene::index::IndexReader*' to
'unsigned int'
How can I search multiple Indexes?
Sincerely,
--
Mohamed Ismail
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers