We have a .aspx page developed that uses Microsoft Indexing Service and we can do both Basic and Advanced search but it seems we still are missing something. If the Basic radio button is selected our matches from the .aspx page match what we get when we query directly from the server. However, when we select the Advanced radio button (CONTAINS) we do not match the same key word(s) used if doing right on the server.
For example, on the server it can handle the phrase: blue dress but on our .aspx file if we select advance the only way we get results if if we double quote this phrase like so "blue dress".
The following results are with the 'Advanced query' selected
blue OR dress :returns 148 records on the Indexing Service Query Form
blue OR dress :returns 113 records on the .aspx page
blue AND dress :returns 10 records on the Indexing Service Query Form
blue AND dress :returns 3 records on the .aspx page
"blue dress" :returns the msgbox 'No results' on the Indexing Service Query Form
"blue dress" :returns 0 records on the .aspx page
blue AND NOT dress :returns 116 records on the Indexing Service Query Form
blue AND NOT dress :returns 101 records on the .aspx page
The sql in my code looks something like this:
VB Code:
Dim d as DateTime .... odbSearch = new OleDbConnection("Provider=MSIDXS;Data=CatalogName") sString = txtSearch.Text.Replace("'", "''") sString = sString.Replace(";", vbNullString) sURL = "SELECT doctitle, filename, rank, access FROM scope() " If radBasic.Checked = True Then sURL &= "WHERE FREETEXT('" + sString + "') " Else sURL &= "WHERE CONTAINS('" + sString + "') " End If If sStartDt.Length > 0 AND sEndDt.Length > 0 THen sDtFormat = "yyyy-MM-dd" d = txtStartDt.Text sStartDt = d.ToString(sDtFormat) d= txtEndDt.Text sEndDt = d.ToString(sDtFormat) sURL &= "AND (Write > '" & sStartDt & "' AND Write < '" & sEndDt & "') " End If
Does anyone know why my results could be so far off and how to handle the advanced section?
If you understand my issue above, maybe you can also explain to me how I can in my code create new properties of files to index and display the results.
Thanks in advance.


Reply With Quote