FAQ
Hello,

I am a newbie user of Lucene Java. I am trying to use Lucene to enable in
search in my application. I am stuck a little in actual Search. I'm facing a
design issue and want help from experts here.

Here is my scenario:
* I have 7-8 tables in the database and I create a separate index for each
table. Index is created in the filesystem. (The fact that there is one index
per table is not under my control and I have to use that as an input)
* Fields in the indices may or may not be the same
* When I search I need to search in all indices

I tried looking at MultiSearcher. But, since the fields in indices are not
the same, I can't make use of one query and give it to the multi searcher. I
need to construct a separate MultiFieldQueryParser for each of my searchers.

If I create an array of searchers myself and call 'search' method on each of
them, I am left with having to merge the results properly (based on score).
But in this case, since the results from each searcher is normalized for
search in that index, merging is not a stright-forward operation and I'll
have to rely on some sort of a HitCollector since I need raw scores which'll
help me in merging the results.

Have people hit this problem before? Is there any other approach I can take?
Any pointers will greatly help me.

Thanks a lot for your time,
Beerbal

Search Discussions

  • 叶双明 at Sep 6, 2008 at 1:36 pm
    In my opinion, you can use MultiSearcher, or if there isn't huge data
    in index, you can put them in one index, no matter the fields in
    indices are not the same. You can get Docoument match your query, but
    I think, you will think about the query that you want to put into the
    IndexSearcher.

    2008/9/6, beerbal@gmail.com <beerbal@gmail.com>:
    Hello,

    I am a newbie user of Lucene Java. I am trying to use Lucene to enable in
    search in my application. I am stuck a little in actual Search. I'm facing a
    design issue and want help from experts here.

    Here is my scenario:
    * I have 7-8 tables in the database and I create a separate index for each
    table. Index is created in the filesystem. (The fact that there is one index
    per table is not under my control and I have to use that as an input)
    * Fields in the indices may or may not be the same
    * When I search I need to search in all indices

    I tried looking at MultiSearcher. But, since the fields in indices are not
    the same, I can't make use of one query and give it to the multi searcher. I
    need to construct a separate MultiFieldQueryParser for each of my searchers.

    If I create an array of searchers myself and call 'search' method on each of
    them, I am left with having to merge the results properly (based on score).
    But in this case, since the results from each searcher is normalized for
    search in that index, merging is not a stright-forward operation and I'll
    have to rely on some sort of a HitCollector since I need raw scores which'll
    help me in merging the results.

    Have people hit this problem before? Is there any other approach I can take?
    Any pointers will greatly help me.

    Thanks a lot for your time,
    Beerbal

    --
    Sorry for my englist!!
  • Xinxin zhou at Sep 7, 2008 at 6:09 am
    2008/9/6 叶双明 <yeshuangming@gmail.com>
    In my opinion, you can use MultiSearcher, or if there isn't huge data
    in index, you can put them in one index, no matter the fields in
    indices are not the same. You can get Docoument match your query, but
    I think, you will think about the query that you want to put into the
    IndexSearcher.


    I think 叶双明 is right。
    BooleanQuery and MultiFieldQuery may help。

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedSep 6, '08 at 9:53a
activeSep 7, '08 at 6:09a
posts3
users3
websitelucene.apache.org

3 users in discussion

Xinxin zhou: 1 post Beerbal: 1 post 叶双明: 1 post

People

Translate

site design / logo © 2022 Grokbase