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:
  1. Dim d as DateTime
  2. ....
  3.  
  4. odbSearch = new OleDbConnection("Provider=MSIDXS;Data=CatalogName")
  5.  
  6. sString = txtSearch.Text.Replace("'", "''")
  7. sString = sString.Replace(";", vbNullString)
  8.  
  9. sURL = "SELECT doctitle, filename, rank, access FROM scope() "
  10. If radBasic.Checked = True Then
  11.   sURL &= "WHERE FREETEXT('" + sString + "') "
  12. Else
  13.  sURL &= "WHERE CONTAINS('" + sString + "') "
  14. End If
  15.  
  16. If sStartDt.Length > 0 AND sEndDt.Length > 0 THen
  17.   sDtFormat = "yyyy-MM-dd"
  18.   d = txtStartDt.Text
  19.   sStartDt = d.ToString(sDtFormat)
  20.   d= txtEndDt.Text
  21.   sEndDt = d.ToString(sDtFormat)
  22.   sURL &= "AND (Write > '" & sStartDt & "' AND Write < '" & sEndDt & "') "
  23. 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.