This commit is contained in:
@@ -986,6 +986,9 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
Cursor savcursor = Cursor;
|
||||
// keeps track of index into combo box for results style. This combo box may have 3 or 4
|
||||
// items depending on whether annotations exist.
|
||||
int cmbResultsStyleIndex = -1;
|
||||
try
|
||||
{
|
||||
lbSrchResults.DataSource = null;
|
||||
@@ -1011,7 +1014,7 @@ namespace Volian.Controls.Library
|
||||
ReportTitle = "PROMS2010 - Search by Type";
|
||||
SearchString = null;
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 1; //display step locations in results
|
||||
cmbResultsStyleIndex = 1; //display step locations in results
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1026,7 +1029,7 @@ namespace Volian.Controls.Library
|
||||
ReportTitle = string.Format("PROMS2010 - {0} Search for '{1}'", cbxBooleanTxtSrch.Checked ? "Boolean" : "Text", TextSearchString);
|
||||
SearchString = TextSearchString;
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
cmbResultsStyleIndex = 3; // display step text in results
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1039,7 +1042,7 @@ namespace Volian.Controls.Library
|
||||
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked);
|
||||
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked);
|
||||
//UpdateAnnotationSearchResults();
|
||||
cmbResultsStyle.SelectedIndex = 2; // display annotation text in results
|
||||
cmbResultsStyleIndex = 2; // display annotation text in results
|
||||
}
|
||||
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search
|
||||
{
|
||||
@@ -1048,15 +1051,17 @@ namespace Volian.Controls.Library
|
||||
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
cmbResultsStyleIndex = 3; // display step text in results
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromROSearch(DVISearchList, TypeSearchList, ROSearchList);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
cmbResultsStyleIndex = 3; // display step text in results
|
||||
}
|
||||
}
|
||||
AddMessageForEmptyAnnotations();
|
||||
if (cmbResultsStyleIndex == 3 && cmbResultsStyle.Items.Count == 3) cmbResultsStyleIndex--;
|
||||
cmbResultsStyle.SelectedIndex = cmbResultsStyleIndex;
|
||||
DisplayResults();
|
||||
if (SearchResults != null && SearchResults.Count == 0)
|
||||
{
|
||||
@@ -1067,7 +1072,10 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
while (ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
MessageBox.Show(ex.Message, "Search Error: " + ex.GetType().Name);
|
||||
string tmpmsg = (cbxBooleanTxtSrch.Checked && ex.Message.Contains("Syntax error") && ex.Message.Contains("full-text search")) ?
|
||||
"Place \"\" around words that you are searching for, so that parser can better understand what you are trying to find" :
|
||||
ex.Message;
|
||||
MessageBox.Show(tmpmsg, "Search Error: " + ex.GetType().Name);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -1080,8 +1088,26 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void AddMessageForEmptyAnnotations()
|
||||
{
|
||||
bool hasAnnot = false;
|
||||
foreach (ItemInfo ii in SearchResults)
|
||||
{
|
||||
if (ii.ItemAnnotationCount > 0)
|
||||
{
|
||||
// RHM - can an iteminfo have an itemannotationcount>0 and not have searchannotationtext.
|
||||
if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
|
||||
}
|
||||
|
||||
if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = "None - [" + ii.DisplayText + "]";
|
||||
else
|
||||
{
|
||||
hasAnnot = true;
|
||||
}
|
||||
}
|
||||
cmbResultsStyle.Items.Clear();
|
||||
cmbResultsStyle.Items.Add(comboItem1);
|
||||
cmbResultsStyle.Items.Add(comboItem2);
|
||||
if (hasAnnot) cmbResultsStyle.Items.Add(comboItem3);
|
||||
cmbResultsStyle.Items.Add(comboItem4);
|
||||
}
|
||||
|
||||
private void cbxTextSearchText_Leave(object sender, EventArgs e)
|
||||
@@ -1444,6 +1470,11 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void cbxBooleanTxtSrch_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// If the Boolean search is not working - run the following two commands in SQL:
|
||||
// use veproms
|
||||
// ALTER FULLTEXT INDEX ON Contents START FULL POPULATION
|
||||
// ALTER FULLTEXT INDEX ON Documents START FULL POPULATION
|
||||
// use master
|
||||
//Boolean search uses a list of noise, or STOP, words. This list can be found
|
||||
// in file: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\noiseenu.txt.
|
||||
// Another file exists in that directory, tsenu.xml, this is a thesaurus. RHM tried
|
||||
|
Reference in New Issue
Block a user