R
rboeckmann
I am new to this group and fairly new to Lucene. I like the speed it
offers when searching but what is the secret to getting the hits
returned.
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 issue is the hits object really doesn't help. What I need is an
xml object. So I convert the hits to a dataset and that to xml. To
complicate things, the term searched in my boolean query is returning
32,000 records. Do I need them all? Probably not but I have to return
them in my webservice.
PLEASE HELP!
offers when searching but what is the secret to getting the hits
returned.
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 issue is the hits object really doesn't help. What I need is an
xml object. So I convert the hits to a dataset and that to xml. To
complicate things, the term searched in my boolean query is returning
32,000 records. Do I need them all? Probably not but I have to return
them in my webservice.
PLEASE HELP!