It's a large text document, if you would compress the xml before sending
it you will be able to get the results transferred. 

This can be done either using WSE or your build your own soapextension.

-----Original Message-----
From: Scott Remiger [mailto:[EMAIL PROTECTED] 
Sent: woensdag 12 maart 2008 17:47
To: lucene-net-user@incubator.apache.org
Subject: Convert Hits to XML

We are currently converting the hits to a dataset then onto an XML
document which seems inefficient

Can someone suggest a better way of doing this?

 

The web service will time out when we get to about 36 thousands hits we
want to get the web service wide open(not limit the number of records to
return);

 

Hits _oRecipeHits = _oLuceneIndexSearch.ExecuteSearch(_bqQuery,
INDEXPATH);

 

            DataTable _dtSearchResults = new DataTable();

            _dtSearchResults.Columns.Add("RecipeID", typeof(string));

            _dtSearchResults.Columns.Add("RecipeTitle", typeof(string));

            _dtSearchResults.Columns.Add("Ingredients", typeof(string));

            _dtSearchResults.Columns.Add("Course", typeof(string));

            _dtSearchResults.Columns.Add("Equipment", typeof(string));

            _dtSearchResults.Columns.Add("Holiday", typeof(string));

            _dtSearchResults.Columns.Add("CookTime", typeof(string));

            _dtSearchResults.Columns.Add("SkillLevel", typeof(string));

            _dtSearchResults.Columns.Add("RecipeRating",
typeof(string));

            _dtSearchResults.Columns.Add("IsPublic", typeof(bool));

            _dtSearchResults.Columns.Add("relevance", typeof(float));

 

if (_oRecipeHits.Length() > 0)

            {

                for (int iResultsCount = 0; iResultsCount <
_oRecipeHits.Length(); iResultsCount++)

                {

                    Document _dResultsDoc =
_oRecipeHits.Doc(iResultsCount);

 

                    DataRow _rRecipe = _dtSearchResults.NewRow();

                    _rRecipe["RecipeID"] = _dResultsDoc.Get("RecipeID");

                    _rRecipe["RecipeTitle"] =
_dResultsDoc.Get("RecipeTitle");

                    _rRecipe["RecipeDescription"] =
_dResultsDoc.Get("RecipeDescription");

                    _rRecipe["Ingredients"] =
_dResultsDoc.Get("Ingredients");

                    _rRecipe["Course"] = _dResultsDoc.Get("Course");

                    _rRecipe["Equipment"] =
_dResultsDoc.Get("Equipment");

                    _rRecipe["Holiday"] = _dResultsDoc.Get("Holiday");

                    _rRecipe["CookTime"] = _dResultsDoc.Get("CookTime");

                    _rRecipe["SkillLevel"] =
_dResultsDoc.Get("SkillLevel");

                    _rRecipe["Region"] = _dResultsDoc.Get("Region");

                    _rRecipe["RecipeRating"] =
_dResultsDoc.Get("RecipeRating");

                    _rRecipe["IsPublic"] =
LUCENE_BOOL_TRUE.Equals(_dResultsDoc.Get("IsPublic"));

                    _rRecipe["relevance"] =
_oRecipeHits.Score(iResultsCount);

 

                    _dtSearchResults.Rows.Add(_rRecipe);

                }

            }

 

Scott Remiger

888 Lumber Exchange Building

10 South Fifth Street

Minneapolis, MN 55402

O: 612.238.4951

F: 612.746.4237

 

Reply via email to