How can I speed up reading the Lucene search results

Discussion in 'Java' started by rhino1130, Mar 12, 2008.

  1. rhino1130

    rhino1130 Guest

    Reading lucene search hits results to xml slow slow. I need the xml
    and can't find a way to convert the hits object directly to xml. So
    now what?

    Since there is no direct way to read it to xml, I have to first
    convert the hits to a dataset then to xml. Here is what I am doing...

    // execute the search
    Hits _oWidgetHits =
    _oLuceneIndexSearch.ExecuteSearch(_booleanqqueryWidgetsQuery,
    INDEXPATH);

    // read hit results
    if (_oWidgetHits.Length() > 0)
    {
    for (int iResultsCount = 0; iResultsCount < _oWidgetHits.Length();
    iResultsCount++)
    {
    // get the document from index
    Document _dResultsDoc = _oWidgetHits.Doc(iResultsCount);

    // create a new row with the result data
    DataRow _rWidgets = _dtSearchResults.NewRow();
    _rWidgets["WidgetID"] = _dResultsDoc.Get("WidgetID");
    _rWidgets["WidgetTitle"] = _dResultsDoc.Get("WidgetTitle");

    // add row
    _dtSearchResults.Rows.Add(_rRecipe);
    }
    }

    return _dtSearchResults;

    I have tried using the hitIterator but that give me no gains. I am
    researching the hitCollector but that seems to be the same concept.

    The problem with the speed really is the number of records. I have
    reduced the results but that really is only a band-aid.
    rhino1130, Mar 12, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ezee
    Replies:
    1
    Views:
    4,144
    Harald
    Jul 30, 2005
  2. Replies:
    0
    Views:
    518
  3. Replies:
    10
    Views:
    786
    Amit Jain
    Aug 20, 2007
  4. Replies:
    0
    Views:
    331
  5. Replies:
    1
    Views:
    173
    Chris Uppal
    Apr 13, 2007
Loading...

Share This Page