FAQ
Hi All,


I need to create dynamic Index Readers based on the user input.

for example

if the user needs to see the records from june 17-june 20


Directory indexFsDir1 =
FSDirectory.getDirectory("C:\\200806\\17\\outgoing1", false);
IndexReader indexIR1 = IndexReader.open(indexFsDir1);

Directory indexFsDir1 =
FSDirectory.getDirectory("C:\\200806\\18\\outgoing1", false);
IndexReader indexIR2 = IndexReader.open(indexFsDir1);

Directory indexFsDir1 =
FSDirectory.getDirectory("C:\\200806\\19\\outgoing1", false);
IndexReader indexIR3 = IndexReader.open(indexFsDir1);

Directory indexFsDir1 =
FSDirectory.getDirectory("C:\\200806\\20\\outgoing1", false);
IndexReader indexIR4 = IndexReader.open(indexFsDir1);


IndexReader[] readArray =
{ indexIR1, indexIR2, indexIR3, indexIR4};



//merged reader
IndexReader mergedReader = new MultiReader(readArray);

IndexSearcher is = new IndexSearcher(mergedReader);

likewise is there any possibility to create Array of Index Readers.


--
View this message in context: http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023594.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Otis Gospodnetic at Jun 20, 2008 at 6:27 am
    Hi,

    Have you looked at MultiReader? Opening IndexReaders like that will cost you...


    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin <sebasmtech@gmail.com>
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:04:12 AM
    Subject: creating Array of IndexReaders


    Hi All,


    I need to create dynamic Index Readers based on the user input.

    for example

    if the user needs to see the records from june 17-june 20


    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\17\\outgoing1", false);
    IndexReader indexIR1 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\18\\outgoing1", false);
    IndexReader indexIR2 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\19\\outgoing1", false);
    IndexReader indexIR3 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\20\\outgoing1", false);
    IndexReader indexIR4 = IndexReader.open(indexFsDir1);


    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    IndexSearcher is = new IndexSearcher(mergedReader);

    likewise is there any possibility to create Array of Index Readers.


    --
    View this message in context:
    http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023594.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Sebastin at Jun 20, 2008 at 6:47 am
    Hi otis,

    Rightnow I am using Multi Reader by just collecting array of indexReaders

    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    its not possible for me to create array of index readers based on the user
    input? IndexReader


    Otis Gospodnetic wrote:
    Hi,

    Have you looked at MultiReader? Opening IndexReaders like that will cost
    you...


    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin <sebasmtech@gmail.com>
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:04:12 AM
    Subject: creating Array of IndexReaders


    Hi All,


    I need to create dynamic Index Readers based on the user input.

    for example

    if the user needs to see the records from june 17-june 20


    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\17\\outgoing1", false);
    IndexReader indexIR1 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\18\\outgoing1", false);
    IndexReader indexIR2 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\19\\outgoing1", false);
    IndexReader indexIR3 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\20\\outgoing1", false);
    IndexReader indexIR4 = IndexReader.open(indexFsDir1);


    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    IndexSearcher is = new IndexSearcher(mergedReader);

    likewise is there any possibility to create Array of Index Readers.


    --
    View this message in context:
    http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023594.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    --
    View this message in context: http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023991.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Otis Gospodnetic at Jun 21, 2008 at 6:10 am
    Hi,

    I think you mentioned 225GB of data somewhere.
    You can open IndexReaders "on demand", but that's not a cheap operation, esp. not with so much data. You want to keep your IndexReaders opened for a while. Multiple requests/threads can share them.

    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin <sebasmtech@gmail.com>
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:46:32 AM
    Subject: Re: creating Array of IndexReaders


    Hi otis,

    Rightnow I am using Multi Reader by just collecting array of indexReaders

    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    its not possible for me to create array of index readers based on the user
    input? IndexReader


    Otis Gospodnetic wrote:
    Hi,

    Have you looked at MultiReader? Opening IndexReaders like that will cost
    you...


    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:04:12 AM
    Subject: creating Array of IndexReaders


    Hi All,


    I need to create dynamic Index Readers based on the user input.

    for example

    if the user needs to see the records from june 17-june 20


    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\17\\outgoing1", false);
    IndexReader indexIR1 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\18\\outgoing1", false);
    IndexReader indexIR2 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\19\\outgoing1", false);
    IndexReader indexIR3 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\20\\outgoing1", false);
    IndexReader indexIR4 = IndexReader.open(indexFsDir1);


    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    IndexSearcher is = new IndexSearcher(mergedReader);

    likewise is there any possibility to create Array of Index Readers.


    --
    View this message in context:
    http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023594.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Sebastin at Jun 21, 2008 at 9:01 am
    Hi otis,

    Since i am maintaining more than 1.5 years records in the windows 2003
    server,based on the user input for example if the user wants to display june
    1 - june 15 folders and fetch the records from them.if the user wants to
    display may 1-may15 records i need to open those folders.thatswhy i am
    opening the index readers based on the user input.is it possible to create
    the array of index raders based on user input.


    Otis Gospodnetic wrote:
    Hi,

    I think you mentioned 225GB of data somewhere.
    You can open IndexReaders "on demand", but that's not a cheap operation,
    esp. not with so much data. You want to keep your IndexReaders opened for
    a while. Multiple requests/threads can share them.

    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin <sebasmtech@gmail.com>
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:46:32 AM
    Subject: Re: creating Array of IndexReaders


    Hi otis,

    Rightnow I am using Multi Reader by just collecting array of indexReaders

    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    its not possible for me to create array of index readers based on the
    user
    input? IndexReader


    Otis Gospodnetic wrote:
    Hi,

    Have you looked at MultiReader? Opening IndexReaders like that will cost
    you...


    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

    ----- Original Message ----
    From: Sebastin
    To: java-user@lucene.apache.org
    Sent: Friday, June 20, 2008 2:04:12 AM
    Subject: creating Array of IndexReaders


    Hi All,


    I need to create dynamic Index Readers based on the user input.

    for example

    if the user needs to see the records from june 17-june 20


    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\17\\outgoing1", false);
    IndexReader indexIR1 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\18\\outgoing1", false);
    IndexReader indexIR2 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\19\\outgoing1", false);
    IndexReader indexIR3 = IndexReader.open(indexFsDir1);

    Directory indexFsDir1 =
    FSDirectory.getDirectory("C:\\200806\\20\\outgoing1", false);
    IndexReader indexIR4 = IndexReader.open(indexFsDir1);


    IndexReader[] readArray =
    { indexIR1, indexIR2, indexIR3, indexIR4};



    //merged reader
    IndexReader mergedReader = new MultiReader(readArray);

    IndexSearcher is = new IndexSearcher(mergedReader);

    likewise is there any possibility to create Array of Index Readers.


    --
    View this message in context:
    http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18023594.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    --
    View this message in context: http://www.nabble.com/creating-Array-of-IndexReaders-tp18023594p18042275.html
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Daniel Noll at Jun 23, 2008 at 1:57 am

    On Saturday 21 June 2008 18:57:49 Sebastin wrote:
    Since i am maintaining more than 1.5 years records in the windows 2003
    server,based on the user input for example if the user wants to display
    june 1 - june 15 folders and fetch the records from them.if the user wants
    to display may 1-may15 records i need to open those folders.thatswhy i am
    opening the index readers based on the user input.is it possible to create
    the array of index raders based on user input.
    Is that not what your original code was already doing? If not, some small
    modification must be all you really need.

    Daniel

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Saikrishna venkata pendyala at Jun 23, 2008 at 11:12 am
    Hi Sebastin ,

    Why dont you index all data into single or some fixed number of indexes and
    search over them. You can always restrict your search using the range query
    based on user given inputs.

    --Sai Krishna.
    On Mon, Jun 23, 2008 at 7:27 AM, Daniel Noll wrote:
    On Saturday 21 June 2008 18:57:49 Sebastin wrote:
    Since i am maintaining more than 1.5 years records in the windows 2003
    server,based on the user input for example if the user wants to display
    june 1 - june 15 folders and fetch the records from them.if the user wants
    to display may 1-may15 records i need to open those folders.thatswhy i am
    opening the index readers based on the user input.is it possible to create
    the array of index raders based on user input.
    Is that not what your original code was already doing? If not, some small
    modification must be all you really need.

    Daniel

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 20, '08 at 6:04a
activeJun 23, '08 at 11:12a
posts7
users4
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase